sdp: Fix m-line ordering when merging offers#888
Merged
algesten merged 1 commit intoalgesten:mainfrom Mar 7, 2026
Merged
Conversation
Owner
|
@bekriebel looks good, but I think that WIP commit is not supposed to be there right? |
Contributor
Author
|
Oh, whoops. That was supposed to be a different test branch. I'll clean that up today. Sorry about that. |
When an offer is sent by a client and the SFU at the same time, we may have a conflict that requires one side to roll back their changes and renegotiate after accepting the incoming offer. However, at least with Chrome, the client may still expect the m-lines to match their ordering even after a rollback. To accomodate this, only increase the index on actions that produce an m-line to ensure an expected increment and, when merging, ensure that the original changes are prepended to the new offer instead of appending them and changing the m-line order. Fixes algesten#887
1083227 to
79c9501
Compare
Contributor
Author
|
@algesten Fixed, and rebased on the current main. I actually ended up resolving my issue in a different way in our codebase, so this is no longer blocking me. However, I do think it is still the correct way to handle these values. I moved that temp commit into it's own PR, #893. This was something else that I found that was also a red herring for my issue, but figured I'd open it in case you want to match the RFC. |
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.
When an offer is sent by a client and the SFU at the same time, we may have a conflict that requires one side to roll back their changes and renegotiate after accepting the incoming offer.
However, at least with Chrome, the client may still expect the m-lines to match their ordering even after a rollback.
To accomodate this, only increase the index on actions that produce an m-line to ensure an expected increment and, when merging, ensure that the original changes are prepended to the new offer instead of appending them and changing the m-line order.
Fixes #887