Repository navigation
fix(ui): reset the event-stream state when the run id changes (gh #1325) - #1329
Closed
lb1192176991-lab wants to merge 1 commit into
Closed
lb1192176991-lab wants to merge 1 commit into
lb1192176991-lab wants to merge 1 commit into
Conversation
…minwest#1325) useEventStream kept the previous run's accumulated events when the run id changed without a remount, so a new run's tail showed stale events and dropped the new run's (its seq numbers restart low). Store the run id in the stream state and reset to empty when it differs, keeping history on a follow flip. The run-isolation decision lives in streamStateForRun so it is testable without a renderer.
Owner
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
useEventStreamkept the previous run's accumulated events when the run id changed without a remount, so a new run's tail showed the previous run's events and silently dropped the new run's (itsseqrestarts low). The stream state now carries the run id and resets to empty when it differs, while keeping history on afollowflip so the replay dedupe still works.Changes
src/ui/src/hooks/use-event-stream.helpers.ts: addEventStreamState,emptyStreamState, andstreamStateForRun(the keep-vs-reset decision, testable without a renderer).src/ui/src/hooks/use-event-stream.ts: storerunIdin state, reset on change, and drop stale in-flight events from a previous run's stream.src/ui/src/hooks/use-event-stream.helpers.test.ts: addstreamStateForRuncases.Test plan
tsc --noEmitpassesbiome checkon changed files passesbun test src/ui/src/hooks/use-event-stream.helpers.test.tspasses (11 tests)