Repository navigation
Conversation
CI proof: the subscriber does not enter an ice restart on a resume
🦋 Changeset detectedLatest commit: 25b6ce4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Devin Review found 2 potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| fun expectRemoteDescription() { | ||
| executeRTCIfNotClosed { awaitedOffers++ } | ||
| } |
There was a problem hiding this comment.
🔴 Server-offer candidates reach the old description
When a server offer precedes a candidate, expectRemoteDescription never runs before the candidate arrives. onServerOffer schedules description application asynchronously, so the candidate can reach the old ICE credentials and be rejected.
Learn more
The signal client delivers offers and trickles through separate callbacks. onServerOffer launches offer handling, leaving a gap before answerServerOffer applies the subscriber description. Nothing calls expectRemoteDescription, so the new wait never covers that gap. A candidate arriving in the gap is handed to WebRTC with the preceding SDP's ICE credentials.
Example: The server sends an ICE-restart offer followed immediately by a subscriber trickle. The candidate reaches the subscriber before the offer coroutine installs the new SDP; WebRTC rejects it instead of receiving it after installation.
Recommended fix: Wire expectRemoteDescription into the subscriber offer path before onServerOffer launches its coroutine. Ensure the wait is ended if offer processing exits without calling setRemoteDescription.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if (iceRestart) { | ||
| awaitedAnswers.add(offerId) | ||
| } |
There was a problem hiding this comment.
🔴 Superseded restart permanently holds candidates
When a second ICE restart replaces an unanswered first offer, awaitedAnswers retains both offer IDs. The replacement's answer removes only its ID, leaving later candidates queued indefinitely.
Learn more
createAndSendOffer permits a second ICE restart while signaling is HAVE_LOCAL_OFFER: it applies the current remote description and creates a new offer. Each restart inserts its ID in awaitedAnswers, but descriptionSettled removes only the answered ID. The first offer was superseded, so its answer need never arrive. Its leftover ID makes awaitingDescription() true indefinitely and prevents all subsequent subscriber/publisher candidates on that transport from being added.
Example: Restart offer 7 remains unanswered when another reconnect triggers restart offer 8. Answer 8 arrives, but 7 remains in the set; every later publisher trickle is queued instead of applied.
Recommended fix: Retire the replaced offer's wait when starting a replacement restart, while preserving the replacement's wait and preventing a late answer to the old ID from releasing it.
Was this helpful? React with 👍 or 👎 to provide feedback.
No description provided.