Skip to content

fix(session): cancel a queued reconnect when the connection restores itself; release 0.11.8 - #71

Merged
akirilyuk merged 2 commits into
mainfrom
fix/restored-cancels-reconnect
Oct 8, 2026
Merged

akirilyuk merged 2 commits into
mainfrom
fix/restored-cancels-reconnect

Conversation

@akirilyuk

Copy link
Copy Markdown
Contributor

Problem

When the ICE connection dropped and then recovered on its own while a reconnect attempt was still waiting in its backoff delay, the attempt fired anyway. It rejoined the session and replaced a healthy peer connection. Seen in load tests: the connection was restored at 10:04:30, and the stale attempt replaced it about 2 s later.

Root cause

scheduleAutoReconnect arms a backoff timer. When the original connection recovers first, markRestoredIfRecovered cleared the recovery timers but not the reconnect timer, so the attempt still ran after the session was already restored.

Fix

markRestoredIfRecovered now clears the pending reconnect timer when the outage was still being recovered via ICE restart (the attempt has not started yet) and logs session/reconnect_cancelled. Attempts already in flight are unaffected.

Tests

Two new cases in browser-voice-session-recovery.test.ts: a restore during attempt 1's backoff creates no new WebSocket or peer connection and leaves the original connection open, and a later outage after a cancelled attempt still reconnects.

Release 0.11.8 (version, lockfile, CHANGELOG).

🤖 Generated with Claude Code

akirilyuk and others added 2 commits October 8, 2026 19:20
…itself; release 0.11.8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akirilyuk
akirilyuk merged commit f0cffe8 into main Oct 8, 2026
8 checks passed
@akirilyuk
akirilyuk deleted the fix/restored-cancels-reconnect branch October 8, 2026 12:27
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