[claude] fix SSE stream registry race condition at 60-second timeout boundary (#16) #56
Reference in New Issue
Block a user
Delete Branch "claude/issue-16"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #16
Changes
DB polling fallback for race condition: When the SSE handler wakes up after the bus event but the stream is already gone (instant stub completion), and the job is still in
executingstate, poll the DB every 2s (max 120s) until the job reaches a terminal state, then replay the result viatoken+doneSSE events.Unit tests: Added 7 tests using
node:testcovering:get()returns nullend()receives all dataWhat was already in place
completebut stream is goneAcceptance Criteria
token+doneerror: Stream not availablewhen job eventually succeeds[claude] fix SSE stream registry race condition at 60s timeout boundary (#16)to [claude] fix SSE stream registry race condition at 60-second timeout boundary (#16)