Skip to content

sdp: keep end-of-candidates when parsing an SDP fragment - #1827

Closed
RaphaelFakhri wants to merge 1 commit into
livekit:mainfrom
RaphaelFakhri:fix/sdp-fragment-end-of-candidates
Closed

RaphaelFakhri wants to merge 1 commit into
livekit:mainfrom
RaphaelFakhri:fix/sdp-fragment-end-of-candidates

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

SDPFragment.Unmarshal drops the a=end-of-candidates attribute, so a trickle ICE fragment that signals the end of candidates never reaches Marshal or PatchICECredentialAndCandidatesIntoSDP.

The parser handles attributes without a value (no :) in an early branch that only recognizes ice-lite and then continues. The case sdp.AttrKeyEndOfCandidates in the switch below that branch is unreachable, because end-of-candidates never contains a colon.

This change handles end-of-candidates in the no-value branch and removes the dead case. The fragment's Marshal output and the SDP produced by PatchICECredentialAndCandidatesIntoSDP now carry the attribute, as the code intends.

Testing

TestSDPFragmentEndOfCandidates parses a fragment that ends with a=end-of-candidates, checks that Marshal round-trips it, and checks that patching the fragment into an offer adds the attribute to the media section. On current main the test fails because the marshalled output lacks the attribute. With the change, go test -race ./sdp passes.

A changeset is included.

@changeset-bot

changeset-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1351bbc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
github.com/livekit/protocol Patch
@livekit/protocol Patch

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

@CLAassistant

CLAassistant commented Sep 29, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants