Skip to content

Stop a failed replay from dropping a deferred ICE restart - #6

Merged
davidtorcivia merged 1 commit into
masterfrom
fix-deferred-offer-drop
Aug 3, 2026
Merged

davidtorcivia merged 1 commit into
masterfrom
fix-deferred-offer-drop

Conversation

@davidtorcivia

Copy link
Copy Markdown
Owner

Found from the CI flake on #5, and it is not just a test problem.

replayDeferredClientOfferLocked cleared the queued client offer before applying it, so any failure inside SetRemoteDescription discarded it permanently: no answer sent, no retry, client left waiting. CI hit it with pion returning "attempting to gather candidates during gathering state".

A deferred offer is either a voice offer or an ICE restart, and an ICE restart is a repair request from a connection already in trouble. That is the worst thing to drop silently.

The offer now stays queued until a replay succeeds. An attempt counter (3) stops an offer that can never apply from retrying at every settling point forever.

Test drives a replay that always fails and asserts the offer survives, the counter bounds it, and no answer is delivered on failure.

Gate: build, lint, go test with -race all pass.

The replay cleared the queued client offer before applying it, so any
failure inside SetRemoteDescription discarded it for good: no answer
sent, no retry, client left waiting. CI caught it as a flake with pion
returning "attempting to gather candidates during gathering state".

An ICE restart is a repair request from a connection that is already in
trouble, so that is the worst thing to drop silently. The offer now
stays queued until a replay succeeds, and an attempt counter is what
stops an offer that can never apply from retrying at every settling
point forever.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidtorcivia
davidtorcivia merged commit 1b7cf50 into master Aug 3, 2026
7 checks passed
@davidtorcivia
davidtorcivia deleted the fix-deferred-offer-drop branch August 3, 2026 02:59
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