Skip to content

Ci base - #1068

Closed
avosa wants to merge 9 commits into
livekit:mainfrom
myzonerocks:ci-base
Closed

Ci base#1068
avosa wants to merge 9 commits into
livekit:mainfrom
myzonerocks:ci-base

Conversation

@avosa

@avosa avosa commented Nov 13, 2026

Copy link
Copy Markdown

No description provided.

@changeset-bot

changeset-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 25b6ce4

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

This PR includes changesets to release 1 package
Name Type
client-sdk-android 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

@avosa avosa closed this Nov 13, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment on lines +373 to +375
fun expectRemoteDescription() {
executeRTCIfNotClosed { awaitedOffers++ }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Server-offer candidates reach the old description

When a server offer precedes a candidate, expectRemoteDescription never runs before the candidate arrives. onServerOffer schedules description application asynchronously, so the candidate can reach the old ICE credentials and be rejected.

Learn more

The signal client delivers offers and trickles through separate callbacks. onServerOffer launches offer handling, leaving a gap before answerServerOffer applies the subscriber description. Nothing calls expectRemoteDescription, so the new wait never covers that gap. A candidate arriving in the gap is handed to WebRTC with the preceding SDP's ICE credentials.

Example: The server sends an ICE-restart offer followed immediately by a subscriber trickle. The candidate reaches the subscriber before the offer coroutine installs the new SDP; WebRTC rejects it instead of receiving it after installation.

Recommended fix: Wire expectRemoteDescription into the subscriber offer path before onServerOffer launches its coroutine. Ensure the wait is ended if offer processing exits without calling setRemoteDescription.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +218 to +220
if (iceRestart) {
awaitedAnswers.add(offerId)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Superseded restart permanently holds candidates

When a second ICE restart replaces an unanswered first offer, awaitedAnswers retains both offer IDs. The replacement's answer removes only its ID, leaving later candidates queued indefinitely.

Learn more

createAndSendOffer permits a second ICE restart while signaling is HAVE_LOCAL_OFFER: it applies the current remote description and creates a new offer. Each restart inserts its ID in awaitedAnswers, but descriptionSettled removes only the answered ID. The first offer was superseded, so its answer need never arrive. Its leftover ID makes awaitingDescription() true indefinitely and prevents all subsequent subscriber/publisher candidates on that transport from being added.

Example: Restart offer 7 remains unanswered when another reconnect triggers restart offer 8. Answer 8 arrives, but 7 remains in the set; every later publisher trickle is queued instead of applied.

Recommended fix: Retire the replaced offer's wait when starting a replacement restart, while preserving the replacement's wait and preventing a late answer to the old ID from releasing it.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant