Repository navigation
fix(threads): recover disconnected thread watches - #920
Merged
Merged
Conversation
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.
Change
A disconnected thread could repeatedly fail to resume with
Unknown/watch_failedwhile Load from scratch restored it. A snapshot from another reader can leave several pending revisions of the same large item in the replay range. Saving those revisions in a single upsert violated PostgreSQL's one-update-per-row rule and rolled back every resume attempt.Keep the latest revision per entity when saving current content pointers, including inline replacements and removals, and prevent older revisions from overwriting newer pointers. Replay still delivers every sequence record. After two transient retries, repeated untyped gateway failures now try a fresh window, then a smaller window, before stopping with recovery actions. Visible messages remain available during recovery; ordinary transport drops retain automatic retries.
The regression reproduces the original failure over WorkerLink and gRPC, then verifies replay catches up without replacing the snapshot. A separate gRPC-to-SSE regression verifies automatic recovery with a fresh window. Updated the transcript and UI API documentation.
Verification
check:tmp: 27 passing tests across thread sequence content replay, replication retention, watch failures, and watch liveness; no temporary files left behind.git diff --checkpassed.Fixes: #864
Fixes: #871