fix(conversation): resync session status on WS reconnect - #433
Open
RonenMars wants to merge 1 commit into
Open
Conversation
session_update is a fire-once push; one lost while backgrounded strands the thinking bubble indefinitely since reconnect never replays it or refetches status.
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.
Summary
The chat view's "thinking" indicator (
ThinkingBubble) is gated onsession.status, which is only ever updated by a livesession_updateWebSocket push.If the app is backgrounded (socket suspended) right when the server emits the completion event, that frame is lost and never replayed.
Reconnecting re-authenticates the socket but never re-syncs session status, so the thinking bubble can get stuck visible indefinitely even though the response finished long ago.
This adds a
wsManager.onStatusChangelistener that invalidates the cached session-status query on every WS reconnect, so a missed status flip gets picked up as soon as the socket comes back.Test plan
LiveConversationViewnpx jest __tests__/integration/components/LiveConversationView.test.tsx— 5/5 passingtsc --noEmitclean for the changed files