Skip to content

fix: prevent media type mismatch in closed media section reuse#363

Merged
ibc merged 3 commits into
versatica:v3from
duyjack:v3
Apr 15, 2026
Merged

fix: prevent media type mismatch in closed media section reuse#363
ibc merged 3 commits into
versatica:v3from
duyjack:v3

Conversation

@duyjack
Copy link
Copy Markdown
Contributor

@duyjack duyjack commented Apr 1, 2026

Description

Fix an issue in RemoteSdp.receive() where closed media sections could be recycled
regardless of their media type, potentially causing type mismatch errors.

Changes

  • Updated the condition for finding recyclable closed media sections
  • Now checks that both m.closed == true AND m.getObject().type === kind
  • This ensures only closed sections with matching media kinds (audio/video/etc) are reused

Motivation

Previously, the code could recycle a closed m=audio section for new m=video media,
which would cause type inconsistencies. The updated logic ensures type compatibility
when attempting to reuse closed media sections.

Testing

This fix prevents potential mismatches between the media section type and the requested kind,
improving the robustness of SDP media section management.

@jmillan
Copy link
Copy Markdown
Member

jmillan commented Apr 3, 2026

Thanks @duyjack , we'll review and check in the following days.

Comment thread src/handlers/sdp/RemoteSdp.ts Outdated
@jmillan
Copy link
Copy Markdown
Member

jmillan commented Apr 7, 2026

This will take few more days as we'd like to make a further research and are currently short on time.

Co-authored-by: Astagor <astagor@gmail.com>
@Astagor
Copy link
Copy Markdown

Astagor commented Apr 10, 2026

My FF users are getting angry. Any info about the fix date? Also please see this #364 (comment) there might other things to fix for FF.

@ibc
Copy link
Copy Markdown
Member

ibc commented Apr 10, 2026

My FF users are getting angry. Any info about the fix date? Also please see this #364 (comment) there might other things to fix for FF.

We are on vacation. Will check this on our arrival to normal life. Please open a separate ticket for that different issue.

@ibc
Copy link
Copy Markdown
Member

ibc commented Apr 15, 2026

Verified that it works and fixes latest Firefox. Merging. Thanks.

@ibc
Copy link
Copy Markdown
Member

ibc commented Apr 15, 2026

NOTE: I will fix CI errors once merged.

@duyjack, for future PRs please run npm run release:check before announcing the PR.

@ibc ibc merged commit 4b14912 into versatica:v3 Apr 15, 2026
0 of 6 checks passed
@ibc
Copy link
Copy Markdown
Member

ibc commented Apr 15, 2026

Released in mediasoup-client 3.18.8.

@duyjack
Copy link
Copy Markdown
Contributor Author

duyjack commented Apr 15, 2026

NOTE: I will fix CI errors once merged.

@duyjack, for future PRs please run npm run release:check before announcing the PR.

okay @ibc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants