Repository navigation
shared-node-store: fix updateTaskNode() surfacing zero notification on a non-OCC write failure - #2098
Merged
Merged
Conversation
…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]>
Contributor
Author
|
APPROVE Independently re-verified:
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updateTaskNode()'s outerhandle.promise.catch((err) => {...})only checkederr instanceof OperationCancelledErrorand returned early for that case. UnlikeupdateNode()'s,deleteNode()'s, andsetNode()'s outer catches, it had no fallbackconflictNotifications.add({ conflictType: 'write-failure', ... })for the general case.An OCC (version-conflict) failure was already handled correctly — the inner closure's own
occErrorbranch raises its ownversion-mismatchnotification. 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 specificversion-mismatchnotification is raised inside the closure, checked by the outer catch instead of re-deriving the classification from the already-shape-strippederr(a realCommandErrorcrossing the Tauri/gRPC boundary is a plain object, notinstanceof Error, so it loses its.code/.conflictDatashape by the time the closure re-throws it). The outer catch now falls back to the same genericwrite-failurenotificationupdateNode()/deleteNode()/setNode()already raise.Tests
Extended
occ-notification-dedup.test.tswith anupdateTaskNode()describe block mirroring its existingupdateNode()/setNode()coverage:version-mismatchnotification on an OCC conflict (not a duplicate).write-failurenotification 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