Skip to content

fix(streaming): reject connect promise on socket error or close#137

Open
mostafaroshdy1 wants to merge 1 commit intoAssemblyAI:mainfrom
mostafaroshdy1:fix/streaming-connection-promise-hang
Open

fix(streaming): reject connect promise on socket error or close#137
mostafaroshdy1 wants to merge 1 commit intoAssemblyAI:mainfrom
mostafaroshdy1:fix/streaming-connection-promise-hang

Conversation

@mostafaroshdy1
Copy link
Copy Markdown

@mostafaroshdy1 mostafaroshdy1 commented Mar 26, 2026

Ensures the StreamingTranscriber.connect() promise does not hang indefinitely if the WebSocket fails to initialize.

  • Added reject() calls to onerror and onclose handlers.
  • Added reject() to onmessage if an application-level error is received.
  • Fixes issue where DNS failures (ENOTFOUND) cause the process to hang or crash without a catchable error.

if you see a better approach to handle this kind of issues , feel free to drop a comment

#136

Ensures the StreamingTranscriber.connect() promise does not hang indefinitely if the WebSocket fails to initialize.

- Added reject() calls to onerror and onclose handlers.
- Added reject() to onmessage if an application-level error is received.
- Fixes issue where DNS failures (ENOTFOUND) cause the process to hang or crash without a catchable error.
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.

1 participant