Skip to content

fix(streaming): stop close() hanging when no Termination frame arrives - #169

Merged
he-james merged 2 commits into
mainfrom
jhe/fix-streaming-close-hang
Aug 13, 2026
Merged

fix(streaming): stop close() hanging when no Termination frame arrives#169
he-james merged 2 commits into
mainfrom
jhe/fix-streaming-close-hang

Conversation

@he-james

Copy link
Copy Markdown
Contributor

close() awaited a promise that only the Termination frame resolved, with no timeout. A socket that died after the client sent Terminate left close() awaiting forever.

  • onclose now releases the waiter; a dead socket sends no more frames.
  • close() bounds the wait at 5000ms, via a new optional terminationTimeout.
  • RealtimeTranscriber had the same bug and gets the same fix.

The existing close() test helper always sends a Termination frame, so this path had no coverage. The two new hang tests fail on the parent commit.

`close()` awaited a promise that only the `Termination` frame resolved, with no
timeout. A socket that died after the client sent Terminate left `close()`
awaiting forever.

- `onclose` now releases the waiter; a dead socket sends no more frames.
- `close()` bounds the wait at 5000ms, via a new optional `terminationTimeout`.
- `RealtimeTranscriber` had the same bug and gets the same fix.

The existing `close()` test helper always sends a Termination frame, so this
path had no coverage. The two new hang tests fail on the parent commit.
@he-james he-james self-assigned this Aug 13, 2026
@he-james
he-james merged commit ef59bb6 into main Aug 13, 2026
3 checks passed
@he-james
he-james deleted the jhe/fix-streaming-close-hang branch August 13, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants