fix(client): chats started from new chat no longer redirect back to new chat - #105
Merged
Merged
Conversation
…ew chat A new chat subscribes under its pre-assigned thread id before the server creates the thread. The server answers "not found", the client marks the thread deleted, and the later thread.created event was ignored because no snapshot was loaded. Clicking the thread in the sidebar then redirected to the new-chat screen. When a deleted thread sees thread.created, clear the deleted state and resubscribe so its snapshot loads. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
enisze
added a commit
that referenced
this pull request
Oct 5, 2026
) Opening a new chat can subscribe to its thread before the server has created it (an open diff panel does this, for example). The server answers "not found" and the client marks the thread deleted. The fix in #105 waited for a thread.created event to undo that, but the server never sends thread.created on the thread stream, so the chat stayed stuck: the header showed the server title while the body rendered the empty draft. Treat any event for a thread marked deleted as proof that it exists and reload its snapshot. Do it at most once per thread state, because archived threads also answer "not found" while their sessions keep streaming. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Clicking a chat that was started from the new-chat screen (e.g. a running thread in the sidebar) dropped you back on the new-chat screen.
A new chat subscribes under its pre-assigned thread id before the server creates the thread. The server answers "not found", and since #76 the client marks the thread
deletedand stays on the replay path. The laterthread.createdevent was ignored because no snapshot was loaded, so the thread stayeddeletedand the thread route redirected to/.Now, when a deleted thread receives
thread.created, the client clears the deleted state and resubscribes so the snapshot loads. Real deletions still stick. Regression test added inthreads-sync.test.ts(fails without the fix).🤖 Generated with Claude Code