Skip to content

fix(client): stale local publishedTracks after mute and SFU reconnect#2230

Merged
jdimovska merged 1 commit intomainfrom
ended-track
May 7, 2026
Merged

fix(client): stale local publishedTracks after mute and SFU reconnect#2230
jdimovska merged 1 commit intomainfrom
ended-track

Conversation

@jdimovska
Copy link
Copy Markdown
Contributor

@jdimovska jdimovska commented May 7, 2026

💡 Overview

Fix a stale "Audio is connecting…" spinner that appeared on the local participant's tile after muting the mic and going through a reconnect. The local publishedTracks was incorrectly being repopulated with AUDIO during reconnect even though the user was muted.

📝 Implementation notes

🎫 Ticket: https://linear.app/stream/issue/XYZ-123

📑 Docs: https://github.com/GetStream/docs-content/pull/

Summary by CodeRabbit

  • Bug Fixes
    • Improved reconnection reliability by fixing incomplete validation checks during connection recovery. The application now properly verifies connection status before attempting to restore connections after network interruptions.

@jdimovska jdimovska requested a review from oliverlaz May 7, 2026 15:47
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 9c37fcd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d6dafb5-bfeb-44de-a992-e92b06d47392

📥 Commits

Reviewing files that changed from the base of the PR and between e48ec08 and 9c37fcd.

📒 Files selected for processing (1)
  • packages/client/src/rtc/Publisher.ts

📝 Walkthrough

Walkthrough

The getAnnouncedTracksForReconnect() method in Publisher.ts adds an additional safety guard that filters out sender tracks not in a live ready state, alongside existing checks for missing bundle and track entities. This prevents potentially invalid tracks from being announced during reconnection.

Changes

Track State Validation on Reconnect

Layer / File(s) Summary
Track State Validation Guard
packages/client/src/rtc/Publisher.ts
Added defensive check to ensure sender tracks are in live ready state before including them in reconnect announcements. Skips entries with missing bundles, absent tracks, or non-live track states.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit bounds through RTCs with care,
Checking tracks are live before they reconnect,
No ghostly bundles lurking anywhere—
Only healthy streams that we protect! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main issue being fixed: stale published tracks appearing after muting and reconnecting.
Description check ✅ Passed The description follows the template with both required sections (Overview and Implementation notes) filled out with relevant details about the bug fix and ticket references.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ended-track

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jdimovska jdimovska merged commit 728147a into main May 7, 2026
17 checks passed
@jdimovska jdimovska deleted the ended-track branch May 7, 2026 15:55
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.

2 participants