fix(ui): silent save-loss — snapshot cursor advanced before persist resolved (CWD-9) - #320
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
Any transient page-save failure was reported as "Saved" while silently dropping the edit: the save path advanced its snapshot cursor before awaiting persistence, so the post-failure retry recomputed an identical snapshot, hit the no-op skip, and resolved as success. Board: CWD-9 (first ship of the Concurrency & Write Durability epic OB-76).
Solution
Advance
lastSnapshot.currentonly afteronSaveresolves, with a monotonic sequence guard so out-of-order resolves of overlapping saves can't regress the cursor (worst case is one redundant re-send, never loss). Deliberately minimal: no saver redesign — backoff/queueing is CWD-6/7. Two invariant comments document the unbounded-retry contract and the pageId-remount assumption.Key file:
packages/ui/src/screens/BlockPageDocument.tsx(+ new test file). New deps: none.Before / After
No visual change — existing save-pill states only; what changed is when they're truthful.
BlockPageDocument.test.tsx"re-sends a rejected snapshot")Test procedure
Review verification (Quinn): mutation test — reverting the one-line fix makes the new test fail on exactly the silent-loss assertion; interleaving probes confirmed no lost update with a mid-flight second edit.
Operational notes
None — no API/schema/config change, no deployment ordering. Deliberate deferral: retry backoff + durable queue land in CWD-6/7; conflict UX in CWD-10.
Verify: green (full
pnpm verify+ full pre-push suite run). Reviews cleared: code (Quinn — APPROVE; concurrency verdict CORRECT; 3 pre-endorsed findings applied in 83125ac).🤖 Generated with Claude Code
https://claude.ai/code/session_018RUicirLRuuZvjJN13N6yN