fix: make server truth end stale web streams - #973
Merged
SamSaffron merged 2 commits intoJul 28, 2026
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.
What
Make stalled response recovery converge on server truth without allowing an old idle sample to cancel a newer send:
/state/statemay retire a transport only when its controller, generation, session ID, and non-empty response ID are unchanged across the state round tripPOST /v1/responsesownership (currentStreamResponseId === '') is never retired by idle pollingWhy
Session 3137 exposed the failure sharply:
/eventsconnection had ended at 18:28:24The likely root failure was a rejected reconciliation killing the nominally infinite reconnect loop. The fix makes that loop exception-safe and adds an independent, ownership-safe server-truth path.
Race invariants
/stateconfirms idle.Verification
node internal/serveui/static/app_sessions_test.jsnode internal/serveui/static/app_stream_test.jsgo test ./internal/serveui/...go build ./statepolling loop