Repository navigation
Fix PersistenceCoordinator race: hasPending gap allows WatchNodes echo to clobber optimistic state - #1315
Merged
malibio merged 2 commits intoJun 4, 2026
Conversation
…tate (closes #1314) When a queued op fires via setTimeout after the executing op completes, there was a brief window where hasPending() returned false. WatchNodes setNode arriving in that window bypassed the skip-while-editing guard and overwrote the just-written optimistic value (e.g. provider='native'). Fix: re-register the queued op in pendingOperations as a placeholder before clearing executingOperations, so hasPending() stays true throughout the transition. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… $state Under vite-plugin-svelte v6 + Svelte 5.56, class getters in .svelte.ts files are compiled via compileModule which routes through the Svelte runtime. A compound `&&` expression returning a plain boolean in a getter with a reactive _creationSource was being mis-evaluated — the compiled output ignored the right-hand false operand and returned a reactive/truthy value instead. Two changes: 1. Cache `plugin.pattern.canRevert` as a plain boolean field `_pluginCanRevert` at construction/mutation time, avoiding deep reactive proxy traversal of the plugin object in the getter. 2. Rewrite `canRevert` getter as an early-return guard instead of a single compound `&&` expression — the compiler handles simple `if` guards correctly. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
malibio
added a commit
that referenced
this pull request
Jun 22, 2026
…o to clobber optimistic state (#1315) * Fix PersistenceCoordinator race: hasPending gap clobbers optimistic state (closes #1314) When a queued op fires via setTimeout after the executing op completes, there was a brief window where hasPending() returned false. WatchNodes setNode arriving in that window bypassed the skip-while-editing guard and overwrote the just-written optimistic value (e.g. provider='native'). Fix: re-register the queued op in pendingOperations as a placeholder before clearing executingOperations, so hasPending() stays true throughout the transition. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Fix PatternState.canRevert: avoid compound && in getter with reactive $state Under vite-plugin-svelte v6 + Svelte 5.56, class getters in .svelte.ts files are compiled via compileModule which routes through the Svelte runtime. A compound `&&` expression returning a plain boolean in a getter with a reactive _creationSource was being mis-evaluated — the compiled output ignored the right-hand false operand and returned a reactive/truthy value instead. Two changes: 1. Cache `plugin.pattern.canRevert` as a plain boolean field `_pluginCanRevert` at construction/mutation time, avoiding deep reactive proxy traversal of the plugin object in the getter. 2. Rewrite `canRevert` getter as an early-return guard instead of a single compound `&&` expression — the compiler handles simple `if` guards correctly. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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.
Closes #1314