Skip to content

fix(tree): stop reporting failed post-save refreshes as save failures and re-read hidden nodes on refresh - #2743

Open
HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/tree-mutation-refresh-errors
Open

fix(tree): stop reporting failed post-save refreshes as save failures and re-read hidden nodes on refresh#2743
HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/tree-mutation-refresh-errors

Conversation

@HandSonic

Copy link
Copy Markdown
Contributor

Related issue

N/A — two regressions found by reviewing 5372213 (race-safe tree refresh); described below.

Summary

  • After a successful datasource save, refreshDataSourceAfterMutation awaited hydrateDataSourceAfterMutation with throwOnError, so a transiently failing tree refresh rejected into ConnectionEdit's save-error toast: the user saw a failed save (and lost the new-datasource selection) although the save persisted. The store action now runs through runMutationRefreshQuietly, which logs the refresh failure instead of rejecting; hydrate's propagating contract and its tests stay unchanged.
  • initHiddenTreeNodeIds early-returned once loaded, so hidden-node config persisted by another window never became visible, even after clicking refresh. A refresh now forces a coordinator reset plus re-read (initHiddenTreeNodeIds(force)).

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • node tsx src/store/tree/dataSourceMutationRefresh.test.ts (2 new cases: quiet wrapper swallows refresh failure after successful save, still hydrates on success) and src/store/tree/hiddenTreeNodeState.test.ts (new cross-window forced re-read case) — all green; loadNamespaceTree/treeDataUpdate/treeNodeLoadState regression suites green.
  • Fork CI green (frontend lint/test/build incl. test:data-source-mutation-refresh): fix(tree): post-save refresh isolation and hidden-node re-read HandSonic/Chat2DB#50.

Risk and compatibility

  • Public API or stored data: N/A.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: N/A.
  • Backward compatibility: hidden-node first-load behavior unchanged; only explicit refreshes re-read.

Reviewer map

  • Start here: dataSourceMutationRefresh.ts (runMutationRefreshQuietly) and initHiddenTreeNodeIds in store/tree/index.tsx.
  • Failure condition: a refresh failure is now silent-but-logged; the tree stays stale until the next manual refresh.
  • Rollback or disable path: revert the two commits independently.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: substantial — fixes and tests drafted with AI assistance, verified locally.

After a successful datasource save, refreshDataSourceAfterMutation awaited
hydrateDataSourceAfterMutation with throwOnError, so a transiently failed
refresh rejected into ConnectionEdit's save-error toast and the user saw a
failed save (and lost the new-datasource selection) even though the save
persisted. The store action now runs through runMutationRefreshQuietly,
which logs the refresh failure instead of rejecting; hydrate's propagating
contract (and its tests) stay unchanged.
initHiddenTreeNodeIds early-returned once loaded, so changes persisted by
another window never became visible even after clicking refresh. A refresh
now forces a coordinator reset and re-read of the persisted hidden-node
config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants