fix(web): replay offline highlights; reading-session queue race - #694
Merged
Merged
Conversation
mrviduus
enabled auto-merge (squash)
October 4, 2026 19:58
mrviduus
disabled auto-merge
October 4, 2026 20:07
mrviduus
added a commit
that referenced
this pull request
Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mrviduus
force-pushed
the
fix/web-highlights-offline
branch
from
October 4, 2026 20:54
6c88c0b to
28e1ae5
Compare
mrviduus
added a commit
that referenced
this pull request
Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mrviduus
force-pushed
the
fix/web-highlights-offline
branch
from
October 4, 2026 21:17
28e1ae5 to
85e1c76
Compare
mrviduus
added a commit
that referenced
this pull request
Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mrviduus
force-pushed
the
fix/web-highlights-offline
branch
from
October 4, 2026 21:42
85e1c76 to
11a86cf
Compare
mrviduus
added a commit
that referenced
this pull request
Oct 4, 2026
… failed reading sessions (#695) * fix(sync): progress LWW compares client clock with itself; mobile retries failed reading sessions - reading_progresses.client_updated_at: catalog progress stale-write guard compared client UpdatedAt with server-stamped UpdatedAt, so a device clock behind the server had newer writes refused with 200. Now compared only with the stored client stamp (ProgressClock), clamped to server now + 5 min so a future clock can't freeze the row. - mobile stamps progress with the time it was recorded (snapshot), like web. - mobile: failed session submits queued in AsyncStorage (cap 50), flushed after each session, on sign-in/app start and on reconnect; cleared on sign-out. Queue rules shared with web. - server: session dedup pre-check covers edition sessions too (unique index already existed). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore: leave web session queue to #694 (avoids conflicting rewrites) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pending highlights survived only in IndexedDB: server load replaced the list and nothing replayed them. Merge server + local pending, replay create/update/delete on load and online; dedupe lost-response creates by anchor; tombstone offline deletes. Session flush removes only settled sessions from a fresh read. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mrviduus
force-pushed
the
fix/web-highlights-offline
branch
from
October 4, 2026 23:09
11a86cf to
24a7a4a
Compare
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.
Why
Architecture review 2026-10, #11 (+ web half of #12): silent data loss on web.
What
pendingin IndexedDB, was never sent, and vanished from the screen on the next server load; offline edits were overwritten by server rows; failed deletes came back. New purelib/highlightSync.ts(planHighlightSync) merges server + local and plans creates/updates/deletes; the hook replays on load and ononline(existinguseNetworkRecovery), serialised so overlapping triggers can't double-POST. Offline deletes leave adeletedtombstone until the DELETE lands.Verified
tscclean; build ok.setOffline(true)reached the server after going online; highlight made with/me/highlightsblocked reached the server after reload, no duplicate, painted.Known limits (follow-ups)
noteText:null, server needsremoveNote) — pre-existing.Rollback
Revert.
🤖 Generated with Claude Code