Repository navigation
fix: stop the transceivers of an unpublished track - #2249
Conversation
🦋 Changeset detectedLatest commit: f7cb95e 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 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| get serverProtocol(): number | undefined { | ||
| return this.latestJoinResponse?.serverInfo?.protocol; | ||
| } |
There was a problem hiding this comment.
🟡 Transceiver cleanup lost after signal resume
When a reconnect response omits serverInfo, serverProtocol loses the protocol advertised at join. resumeConnection replaces the saved server info with that missing field. Later unpublishes retain transceiver encoders until disconnect.
Learn more
The engine reads serverProtocol from its last join response. A signal resume can return a valid reconnect response without serverInfo; resumeConnection then assigns that absent field to the saved join response. removeTrack consequently disables stopping transceivers, even if the existing peer connection joined a protocol-19 server. Its stopped encoders remain allocated until disconnect.
Example: Join with serverInfo.protocol = 19, then resume signaling with a ReconnectResponse containing ICE servers but no serverInfo. Unpublishing a screen share calls removeTrack without stopping its transceiver, unlike an unpublish before resume.
Recommended fix: Preserve the last known protocol for the current peer connection when a reconnect response omits serverInfo. If a resume can switch to a different server version, define how to validate that version before retaining the protocol. Add a reconnect regression test covering a missing serverInfo.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Interesting case, this might be worth validating / adding a test to cover either way.
size-limit report 📦
|
1egoman
left a comment
There was a problem hiding this comment.
Makes sense to me at a high level.
Reapplies #2221, which #2244 reverted. #2160 must merge first because of the protocol update.
🤖 Generated with Claude Code