fix: live-stream continuity across SSE reconnects - #5
Open
XKILLER2006Y wants to merge 1 commit into
Open
Conversation
SSE resumes from 'now' after a reconnect — it never replays events that streamed while the connection was down (mobile OS idle kill during a long thinking gap, LAN blip, app backgrounding). The old resync only recovered busy->idle transitions, so tokens that arrived during the gap were lost forever and the answer appeared 'cut'. - sessions.ts: add catchUpSessionMessages() — re-fetch the current session's messages/parts and merge with on-screen state, preserving temp- optimistic placeholders (established loadOlderMessages merge pattern). - events.ts: fire the catch-up once per re-established stream, alongside the existing busy-session resync.
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
SSE does not replay events that streamed while the connection was down (mobile OS idle kill during long thinking gap, LAN blip, backgrounding). Tokens arriving during the gap were lost forever — answers appeared 'cut'. The existing resync only recovered busy→idle transitions, not answer content.
Fix
Verification