Repository navigation
fix: allow publisher-only ICE recovery #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ajma
wants to merge
1
commit into
livekit:main
Choose a base branch
from
ajma:fix/publisher-only-reconnect
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−5
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "client-sdk-android": patch | ||
| --- | ||
|
|
||
| Let publishing participants complete a reconnect after publisher ICE recovers when the publisher is primary and the participant explicitly lacks subscribe permission. |
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Premature rejoin after subscribe grant
If permission is granted during a publisher-only resume,
waitUntilConnectedstill returns as soon as the publisher connects.isConnectedthen requires the subscriber. If subscriber ICE is still starting, the engine abandons the resume and starts a full rejoin.Learn more
The subscriber is the connection that receives remote media. The soft reconnect path starts collecting signaling responses asynchronously through onReadyForResponses. A participant update can therefore change the local subscribe permission while the reconnect waits for ICE. The wait uses the permission at entry, but the final connection check uses it at completion. If these decisions disagree, the reconnect loop moves on to a full rejoin even though the ICE deadline has not expired. onFullReconnecting then tears down remote participant state.
Example: A publisher starts resuming with subscribe permission denied and an idle subscriber peer. A server update grants permission while publisher ICE is still recovering. The publisher connects first and the subscriber is still connecting. The resume fails immediately instead of waiting for the subscriber within the remaining ICE budget.
Recommended fix: Make reconnect readiness observe both permission and peer state until the existing ICE deadline. If the final check observes that the subscriber has just become required, continue waiting within that deadline instead of falling through to a full rejoin. Add a test that grants permission after the wait starts and connects the subscriber after the publisher.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I confirmed this race in the reconnect path.
waitUntilConnected()decides whether to wait for the subscriber when it starts, whileisConnected()reads the latest permission. If a grant arrives before publisher ICE connects, the final check can reject the resume while the subscriber is still connecting and there’s time left in the ICE timeout.The fix should use one readiness check that observes permission and peer state within the existing ICE timeout. A regression test should grant subscribe permission after the wait starts, connect the publisher first, and verify that the resume completes only after the subscriber connects.