Fix silent mic race between Room.connect audio publish and setMicrophoneEnabled - #988
Merged
Merged
Conversation
…oneEnabled When connecting with ConnectOptions.audio = true while the app enables the mic as soon as the room reports CONNECTED, both paths published the same default audio track. Room.connect's publish did not take the per-source publish lock, so the losing path's duplicate publish failed and its failure branch stopped the just-published track, leaving the publication unmuted but sending silence until the mic was toggled. - Route Room.connect's audio/video publishes through setMicrophoneEnabled/ setCameraEnabled so they serialize on the source publish lock, where "already published" unmutes instead of failing. - In setTrackEnabled, don't stop a track whose publish was rejected as a duplicate: it is live and owned by the concurrent publisher. - Log a warning in publishTrackImpl's previously silent duplicate branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 66b81b8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
|
Diffuse output: AARJAR |
MaxHeimbrock
marked this pull request as ready for review
July 30, 2026 15:10
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.
Encountered when trying the android agent starter app. 50% of the time I had to mute and unmute again until the agent and transcription reacted to me talking.
Confirmed the fix in the agent starter app, but had to rebase onto 2.26.0 because TokenRequestOptions gained an agentDeployment parameter in released SDK 2.26.1 (#968). Data-class parameter additions change the constructor signature, so components 2.4.0 — compiled against 2.26.0 — crashes on any released SDK ≥ 2.26.1, including 2.27.0. Latest components + latest SDK is a broken pair for every user right now.
Background
When connecting with ConnectOptions.audio = true while the app enables the mic as soon as the room reports CONNECTED, both paths published the same default audio track. Room.connect's publish did not take the per-source publish lock, so the losing path's duplicate publish failed and its failure branch stopped the just-published track, leaving the publication unmuted but sending silence until the mic was toggled.
Changes