Skip to content

fix(client): chats started from new chat no longer redirect back to new chat - #105

Merged
enisze merged 1 commit into
mainfrom
fix/recreated-thread-stuck-deleted
Oct 5, 2026
Merged

enisze merged 1 commit into
mainfrom
fix/recreated-thread-stuck-deleted

Conversation

@enisze

@enisze enisze commented Oct 5, 2026

Copy link
Copy Markdown
Owner

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 deleted and stays on the replay path. The later thread.created event was ignored because no snapshot was loaded, so the thread stayed deleted and 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 in threads-sync.test.ts (fails without the fix).

🤖 Generated with Claude Code

…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>
@github-actions github-actions Bot added size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Oct 5, 2026
@enisze
enisze merged commit 50aad7f into main Oct 5, 2026
7 of 16 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant