Stop retrying unavailable thread subscriptions#18
Closed
tim-smart wants to merge 1 commit into
Closed
Conversation
- Distinguish deleted and archived threads from transient projection misses - Mark deleted threads locally and terminate permanent subscription failures
Owner
Author
|
Duplicate of #17 — that PR is now retargeted onto t3code/worktree-remove-confirmation for the stack. |
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
Subscribing to a deleted (or archived) thread's detail stream previously retried every 250 ms forever — up to the state's 5-minute idle TTL per dead thread — flooding the WebSocket RPC log with
Thread … was not founderrors (~4/sec per thread).OrchestrationGetSnapshotErrorgains an optionalreason:thread-deleted/thread-archived/thread-missing(optional keeps it wire-compatible in both directions).subscribeThreadhandler distinguishes the cases via a newProjectionSnapshotQuery.getThreadLifecycleByIdthat reads the projection row without the deleted/archived filters.thread-deletedas terminal (marks the thread deleted, purges the cache, stops resubscribing) andthread-archivedas terminal-with-cached-data.thread-missingkeeps the 250 ms retry so the subscribe-before-projection race on freshly created threads still converges.Testing
threads-sync.test.ts(deleted → terminal + state deleted, archived → terminal + cache kept, missing → retries)server.test.ts,ProjectionSnapshotQuery.test.ts, client-runtime package, repo typecheck + lint — all green on top oft3code/worktree-remove-confirmation🤖 Generated with Claude Code