You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AsyncRealTimeTranscriber.disconnect() returns while a pending handshake later opens a live session #309
AsyncRealTimeTranscriber.disconnect() does not own a connect() that is still in its WebSocket handshake. Disconnect sets the stop event, finds no socket or tasks, and returns. The handshake then completes, installs a live socket and starts the read/write loops, after cleanup has already returned. Nothing closes that session unless the caller calls disconnect() again.
Reproduction
At 0ba094c, with a local WebSocket server that holds its upgrade response, valid 16 kHz parameters and default timeouts:
connect() returns normally and the server holds an open session that the SDK never closes. The same gap lets two concurrent connect() calls both pass the single-use guard, since the guard is checked before the handshake's first await and only looks at the socket.
Related: the review on #197 covered reconnecting an established connection; this is the pending-handshake case. A fix with regression tests follows.
Activity