Skip to content

shared-node-store: fix updateTaskNode() surfacing zero notification on a non-OCC write failure - #2098

Merged
mstomar125 merged 1 commit into
mainfrom
issue-2092-updatetasknode-silent-failure
Aug 14, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-2092-updatetasknode-silent-failure

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

updateTaskNode()'s outer handle.promise.catch((err) => {...}) only checked err instanceof OperationCancelledError and returned early for that case. Unlike updateNode()'s, deleteNode()'s, and setNode()'s outer catches, it had no fallback conflictNotifications.add({ conflictType: 'write-failure', ... }) for the general case.

An OCC (version-conflict) failure was already handled correctly — the inner closure's own occError branch raises its own version-mismatch notification. But a non-OCC failure (network error, daemon offline, validation error) was NOT handled anywhere: the inner catch logs, tracks the error for tests, rolls back bookkeeping, and re-throws, but nothing downstream ever added a notification for this case.

Since updateTaskNode() is called fire-and-forget (void-returning) from every UI call site, a user changing a task's status/priority/due date during a network blip saw zero toast, zero error, nothing — the UI just reverted (or, post-#2088's fix, silently kept the optimistic value) with no explanation, which reads as a bug/glitch rather than a reported failure.

Fix

Fixed the same way #2091 fixed the equivalent duplicate-notification bug for updateNode(): a captured boolean (occConflictAlreadyNotified), set at the point the specific version-mismatch notification is raised inside the closure, checked by the outer catch instead of re-deriving the classification from the already-shape-stripped err (a real CommandError crossing the Tauri/gRPC boundary is a plain object, not instanceof Error, so it loses its .code/.conflictData shape by the time the closure re-throws it). The outer catch now falls back to the same generic write-failure notification updateNode()/deleteNode()/setNode() already raise.

Tests

Extended occ-notification-dedup.test.ts with an updateTaskNode() describe block mirroring its existing updateNode()/setNode() coverage:

  • Exactly one version-mismatch notification on an OCC conflict (not a duplicate).
  • Exactly one write-failure notification on a non-OCC failure — verified to fail against the pre-fix code (0 notifications, matching the reported bug) before this fix, and pass (1 notification) after.

Also fixed a now-stale comment in updatetasknode-rollback-clobber-regression.test.ts (#2088) that described this exact gap as unaddressed/out of scope.

Full suite run cold (cache cleared): all 210 files / 4658 tests green, no flakes this run.

Closes #2092

🤖 Generated with Claude Code

…n a non-OCC write failure

updateTaskNode()'s outer handle.promise.catch((err) => {...}) only
checked err instanceof OperationCancelledError and returned early for
that case. Unlike updateNode()'s, deleteNode()'s, and setNode()'s
outer catches, it had no fallback conflictNotifications.add({
conflictType: 'write-failure', ... }) for the general case.

An OCC (version-conflict) failure was already handled correctly — the
inner closure's own occError branch raises its own version-mismatch
notification. But a non-OCC failure (network error, daemon offline,
validation error) was NOT handled anywhere: the inner catch logs,
tracks the error for tests, rolls back bookkeeping, and re-throws, but
nothing downstream ever added a notification for this case. Since
updateTaskNode() is called fire-and-forget (void-returning) from every
UI call site, a user changing a task's status/priority/due date during
a network blip saw zero toast, zero error, nothing — the UI just
reverted (or, post-#2088's fix, silently kept the optimistic value)
with no explanation.

Fixed the same way #2091 fixed the equivalent duplicate-notification
bug for updateNode(): a captured boolean (occConflictAlreadyNotified),
set at the point the specific version-mismatch notification is raised
inside the closure, checked by the outer catch instead of re-deriving
the classification from the already-shape-stripped err. The outer
catch now falls back to the same generic write-failure notification
updateNode()/deleteNode()/setNode() already raise.

Extended occ-notification-dedup.test.ts with an updateTaskNode()
describe block mirroring its existing updateNode()/setNode() coverage:
exactly one version-mismatch notification on an OCC conflict (not a
duplicate), and exactly one write-failure notification on a non-OCC
failure (verified to fail against the pre-fix code: 0 notifications,
matching the reported bug, before this fix; 1 after).

Also fixed a now-stale comment in updatetasknode-rollback-clobber-
regression.test.ts (#2088) that described this exact gap as
unaddressed.

Closes #2092

Co-Authored-By: Claude <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE

Independently re-verified:

  • Diff is exactly the intended fix: 3 files (production file + occ-notification-dedup.test.ts extended with an updateTaskNode() describe block + a comment-only fix in updatetasknode-rollback-clobber-regression.test.ts correcting a now-stale "gap tracked separately" note).
  • Confirmed occConflictAlreadyNotified is declared in the correct outer scope, set exactly once (right after the unconditional version-mismatch notification inside if (occError), covering both the direct-hydration and resync-fallback sub-branches), and checked correctly in the outer handle.promise.catch() — structurally identical to updateNode()'s already-merged pattern from shared-node-store: fix OCC error-shape stripping causing a duplicate notification in updateNode() #2091.
  • Ran the full test suite cold (cache cleared): 210 files / 4658 tests, all green.
  • New regression test verified to fail against the pre-fix code (0 notifications, matching the exact reported bug) and pass with the fix (1 write-failure notification).
  • Spawned an independent adversarial review sub-agent: verdict APPROVE, no blocking issues, not even nits. It independently re-confirmed the reproduction via an isolated scratch worktree at the parent commit, verified the OCC-branch flag placement by reading the brace structure directly, and confirmed test soundness (not flaky by construction, correctly seeded with a single setNode() call since updateTaskNode() has no persistedNodeIds-gated branch unlike updateNode()).
  • Reviewed the one flagged question (the fire-and-forget resyncNodeFromServer(...).catch() not touching conflictNotifications on its own secondary failure) — confirmed out of scope: the version-mismatch notification already fires unconditionally before that point, so the user already has signal; this mirrors the identical pre-existing, already-merged updateNode() pattern, not something introduced or expected to be fixed here.
  • Scope check: exactly 3 files changed, nothing under packages/agent, nlp-engine, skills, eval, playbook, ai-chat, and PR Classify node types by frontend integration, not core-list membership (closes #1998) #2013 untouched.

This closes out the same-day chain (#2088 → #2095, #2090 → #2096, #2092 → this PR), all three now landing the exact fix pattern each issue asked for. Merging.

@mstomar125
mstomar125 merged commit df27df2 into main Aug 14, 2026
@mstomar125
mstomar125 deleted the issue-2092-updatetasknode-silent-failure branch August 14, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

updateTaskNode() surfaces zero user-visible notification on a non-OCC write failure

1 participant