Skip to content

Mute sync resume no longer races the media replay - #1844

Draft
aleksandar-apostolov wants to merge 1 commit into
developfrom
fix/and-1549-mute-resume-flush-races-replay
Draft

aleksandar-apostolov wants to merge 1 commit into
developfrom
fix/and-1549-mute-resume-flush-races-replay

Conversation

@aleksandar-apostolov

Copy link
Copy Markdown
Contributor

Goal

Fixes AND-1549

Follow-up to #1796.

Implementation

  • resumeMuteSync() only re-opens the muteSyncEnabled gate. The listenToMediaChanges()
    collectLatest replay is the single path that re-signals tracks after reconnect.
  • Removed pendingMuteSyncTracks and its bookkeeping in syncMuteStateToSfu(), cleanup()
    and cancelActiveWork().
  • Gate behaviour unchanged: collectors still record local bits while paused and still never
    post to a torn-down SFU.

Net -41 lines. No public API change.

Testing

  • ./gradlew :stream-video-android-core:testDebugUnitTest — 1270 passed, 0 failed
  • ./gradlew :stream-video-android-core:spotlessCheck :stream-video-android-core:apiCheck
  • RtcSessionTest2 gains mute sync resumes without replaying the tracks it skipped
    verified it fails when the flush is reinstated.
  • Device repro from AND-1549 not yet re-run against this branch.

resumeMuteSync flushed the tracks skipped while the SFU was being torn
down, then connectRtc restarted listenToMediaChanges and its collectLatest
replay re-signalled the same tracks milliseconds later. The same-track job
coalescing cancelled the flush mid-request, logging IOException: Canceled -
the symptom the gate was added to remove.

The replay already re-signals camera, microphone and screen-share on the
only path that reaches the flush, so resume now just re-opens the gate and
pendingMuteSyncTracks goes away with it.

Closes AND-1549
@aleksandar-apostolov aleksandar-apostolov added the pr:bug Fixes a bug label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.38 MB 12.38 MB 0.00 MB 🟢
stream-video-android-ui-xml 5.68 MB 5.68 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.23 MB 6.23 MB 0.00 MB 🟢

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

Labels

pr:bug Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant