fix(chat): prevent duplicate user message bubble#115
Closed
Conversation
The initial prompt was emitted to the WebSocket via `emit()` which both persisted to the event store AND sent it to the live client. Since the client already renders the message optimistically via USER_SEND (with a different messageId format), the dedup check failed and the message appeared twice. Switch to direct `store.append()` so the initial prompt is persisted for session restore but not broadcast to the already-rendering client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Superseded by #113 which fixes both the duplicate bubble and the vanishing/misordered prompt on reload. |
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
query-loop.tsemitteduser_messageto the WebSocket (viaemit()) while the client had already rendered it optimistically viaUSER_SENDuseChatMessages.tscomparedmessageId, but client useduser-*format while server usedumsg-*— so dedup failedstore.append()so the initial prompt is persisted for session restore but not broadcast to the live clientTest plan
user_messageis NOT sent to WS for initial prompt🤖 Generated with Claude Code