Repository navigation
fix: keep the last transceiver of the publisher connection - #2282
Merged
Merged
Conversation
A stop of the only live m-section makes the browser drop the ICE and DTLS transport. The next publish then needs a new transport, and the server cannot set one up on the same connection, so no media arrives. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 098c288 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 |
lukasIO
marked this pull request as ready for review
November 16, 2026 18:45
Contributor
size-limit report 📦
|
1egoman
approved these changes
Nov 17, 2026
1egoman
left a comment
Contributor
There was a problem hiding this comment.
I think I get it, make sure there's always at least one transceiver open (of any type) so the webrtc connection stays in a healthy state.
xianshijing-lk
approved these changes
Nov 17, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #2249, a participant that unpublishes its only track cannot publish again. The next track is published in the room, but no media arrives, and the publisher connection stays in
connecting.The cause is the stop of the only live m-section of the publisher connection. The browser then rejects all sections of the bundle and drops the ICE and DTLS transport. The next publish reuses the section with a new mid, new ICE credentials and a new DTLS transport. The server restarts ICE on the same connection, but it does not run a second DTLS handshake. #2244 reverted the first version of this change for the same reason.
Change
If a transceiver is the last live m-section of the connection,
PCTransport.stopTransceiversdoes not stop it. That transceiver stays inactive, as before #2249. A negotiated data channel section counts as live, because it also keeps the transport.The connection keeps at most one such transceiver. The next unpublish stops its own transceiver, because the inactive one is still live.
Verified
pnpm test:e2eforsrc/room/PCTransport.e2e.test.tsin Chromium: 3 tests pass. The new testkeeps the only transceiver, so the connection keeps its transportfails without the fix, because the transceiver is stopped and its section is reused.main(491d314a) withaddIceCandidateerrors and no audio after 10 seconds. It passes with this branch.npx vitest run src/room: 793 tests pass.npx tsc --noEmit,eslintandprettier --checkpass.🤖 Generated with Claude Code