Skip to content

Conversation

@coder-with-a-bushido
Copy link

@coder-with-a-bushido coder-with-a-bushido commented Jan 20, 2026

Closes #962

How does it fix that?

The methods publishAudioTrack and publishVideoTrack are called on call reconnection here -

Future<void> rePublishAllTracks() async {
final tracks = trackPublications.values.toList();
trackPublications.clear();
for (LocalTrackPublication track in tracks) {
if (track.track is LocalAudioTrack) {
await publishAudioTrack(track.track as LocalAudioTrack);
} else if (track.track is LocalVideoTrack) {
await publishVideoTrack(track.track as LocalVideoTrack);
}
}
}

But inside the methods we're not passing the muted state from the old tracks we have. It defaults to false because it's not set in protobuf:

if (muted != null) result.muted = muted;

By passing it correctly, this PR fixes the bug in the linked issue.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the muted state of audio and video tracks was not being correctly propagated when publishing to the server.

✏️ Tip: You can customize this high-level summary in your review settings.

@CLAassistant
Copy link

CLAassistant commented Jan 20, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Propagates the track's muted state to the server when adding audio and video tracks by using track.muted instead of hardcoding false values in AddTrackRequest.

Changes

Cohort / File(s) Summary
Muted State Propagation
lib/src/participant/local.dart
Modified audio and video track add requests to propagate track.muted state to server instead of hardcoding false, fixing mute state persistence on reconnection

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐰 A muted state now sticks around,
No more silence lost and found!
Track the truth, don't fake it false,
Reconnect without a cost! 🎙️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: setting proper mute state for audio/video tracks during reconnection, which directly addresses the core issue being fixed.
Linked Issues check ✅ Passed The PR implementation passes the muted state from existing tracks when republishing, directly addressing issue #962's requirement that mute state should persist across reconnection.
Out of Scope Changes check ✅ Passed All changes are confined to the participant/local.dart file and focused on propagating the muted state during track publishing, directly aligned with the reconnection issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70d4d1f and 5bddafe.

📒 Files selected for processing (1)
  • lib/src/participant/local.dart
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Build for Flutter Web WASM
  • GitHub Check: Build for Flutter Linux
  • GitHub Check: Build for Flutter Windows
  • GitHub Check: Build for Flutter macOS
  • GitHub Check: Build for Flutter Web
  • GitHub Check: Build for Flutter Android
  • GitHub Check: Build for Flutter iOS
🔇 Additional comments (3)
lib/src/participant/local.dart (3)

132-142: LGTM! Correct propagation of mute state for audio tracks.

This change ensures that when an audio track is (re)published—particularly during reconnection via rePublishAllTracks()—the track's current muted state is communicated to the server, fixing the issue where the protobuf field defaulted to false.


355-367: LGTM! Correct propagation of mute state for video tracks.

Same fix applied consistently to video track publishing. This ensures video track mute state is preserved across reconnections.


869-885: No muted field needed here; backup codec inherits mute state from publication.

The AddTrackRequest at line 869 intentionally omits the muted field because it adds a backup codec to an already-published track, not a new publication. The sid field links this request to the existing publication, whose mute state is already managed. Backup codec variants inherit the publication-level mute state, so there's no risk of inconsistent behavior.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Incorrect and no-op microphone mute state on call reconnection

2 participants