Repository navigation
fix(tui): keep one row when a message is re-sent with the same id - #51033
Open
myagizmaktav wants to merge 1 commit into
Open
myagizmaktav wants to merge 1 commit into
myagizmaktav wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
This was referenced Sep 24, 2026
This was referenced Sep 26, 2026
Closed
This branch has not been deployed
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.
Issue for this PR
Fixes #50945
Type of change
What does this PR do?
The TUI sync store finds messages by
time.created + id. When a prompt reuses an existingmessageID, the server re-emitsmessage.updatedfor the same id with a newtime.created. The lookup misses, so the handler splices in a second row, and because parts are keyed by message id, both rows render the same content.The
message.updatedhandler now looks up an existing row byidfirst:time.created: reconcile in place (same as before)time.createdchanged: remove the old row and re-insert it at its creation-time position, so the ordering from fix(tui): order messages by creation time #40994 is keptThe parts store is untouched.
How did you verify your code works?
Added a regression test in
packages/tui/test/cli/cmd/tui/sync-live-hydration.test.tsx. It sendsmsg_xat t=10,msg_yat t=30, thenmsg_xagain at t=50, and expects onemsg_xrow, ordered[msg_y, msg_x], withtime.created === 50.cd packages/tui && bun test test/cli/cmd/tui: 24 pass, 0 failcd packages/tui && bun run typecheck: cleansync.tsx, the new test fails (6 pass, 1 fail) because the duplicate row appearsScreenshots / recordings
N/A. This is a state-store change, covered by the test above.
Checklist