Skip to content

fix(llc): rejoin escalation fixes - #1284

Merged
Brazol merged 3 commits into
mainfrom
fix/fast-recon-improv
Jul 17, 2026
Merged

fix(llc): rejoin escalation fixes#1284
Brazol merged 3 commits into
mainfrom
fix/fast-recon-improv

Conversation

@Brazol

@Brazol Brazol commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved call recovery by keeping fast reconnection attempts active until the fast-reconnect deadline before escalating.
    • ICE restart and peer-connection failures now trigger fast reconnection rather than an immediate rejoin.
    • Transient ICE disconnected no longer forces an unhealthy-path rejoin; only permanently closed connections do.
    • Enhanced publisher recovery for stalled negotiation scenarios, including new ICE and stuck have-local-offer signaling.
  • Tests
    • Added and updated reconnection test cases to reflect the new fast/rejoin decision behavior.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

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: 11d3e60a-9d32-4e26-9c97-b7fb14060530

📥 Commits

Reviewing files that changed from the base of the PR and between 687aac0 and b0fe502.

📒 Files selected for processing (1)
  • packages/stream_video/lib/src/call/call.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/stream_video/lib/src/call/call.dart

📝 Walkthrough

Walkthrough

Publisher reconnection now remains on the fast strategy until explicit escalation conditions are met. Closed peer connections trigger rejoin, transient disconnections remain healthy, and stalled publisher negotiation receives asynchronous recovery coverage.

Changes

Reconnection recovery

Layer / File(s) Summary
Peer connection recovery signals
packages/stream_video/lib/src/webrtc/peer_connection.dart, packages/stream_video/test/src/webrtc/*
ICE restart and failed peer connections now request fast reconnect; disconnected states remain healthy, while closed states are detected separately.
Call reconnect escalation
packages/stream_video/lib/src/call/call.dart, packages/stream_video/CHANGELOG.md
Rejoin escalation now considers pending state, deadlines, migration, attempt limits, and closed peer connections.
Publisher stall recovery
packages/stream_video/lib/src/call/session/call_session.dart, packages/stream_video/test/src/call/session/*
Stalled publisher negotiation is retried asynchronously and escalates to rejoin when recovery fails; stable signaling remains unchanged.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CallSession
  participant StreamPeerConnection
  participant Call
  CallSession->>StreamPeerConnection: check ICE and signaling state
  StreamPeerConnection-->>CallSession: report stalled or failed recovery
  CallSession->>Call: request rejoin after failed renegotiation
  StreamPeerConnection->>Call: request fast reconnect after failure
  Call->>Call: escalate to rejoin after deadline, limit, migration, pending state, or closure
Loading

Possibly related PRs

Suggested reviewers: renefloor, xsahil03x

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing and does not follow the required template sections or checklist. Add the required Goal, Implementation details, UI Changes if any, Testing, and checklist sections, and fill them with PR-specific details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the reconnect escalation fixes in this change.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fast-recon-improv

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.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.10%. Comparing base (8ae191d) to head (b0fe502).

Files with missing lines Patch % Lines
...tream_video/lib/src/call/session/call_session.dart 75.00% 4 Missing ⚠️
...s/stream_video/lib/src/webrtc/peer_connection.dart 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1284      +/-   ##
==========================================
+ Coverage   11.07%   11.10%   +0.03%     
==========================================
  Files         686      686              
  Lines       50337    50350      +13     
==========================================
+ Hits         5576     5593      +17     
+ Misses      44761    44757       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Brazol
Brazol marked this pull request as ready for review July 16, 2026 13:08
@Brazol
Brazol requested a review from a team as a code owner July 16, 2026 13:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/stream_video/lib/src/call/call.dart`:
- Around line 2066-2081: Update the shouldRejoin decision in _reconnect to
remain true whenever the current SfuReconnectionStrategy is rejoin, including
after a failed attempt. Preserve the existing pending, migration, attempt-limit,
and closed-peer-connection conditions so an already-required full rejoin cannot
downgrade to fast reconnect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47677738-1b1a-44cf-aba9-81d8d2d15363

📥 Commits

Reviewing files that changed from the base of the PR and between 8ae191d and 687aac0.

📒 Files selected for processing (6)
  • packages/stream_video/CHANGELOG.md
  • packages/stream_video/lib/src/call/call.dart
  • packages/stream_video/lib/src/call/session/call_session.dart
  • packages/stream_video/lib/src/webrtc/peer_connection.dart
  • packages/stream_video/test/src/call/session/call_session_reconnect_safety_test.dart
  • packages/stream_video/test/src/webrtc/peer_connection_renegotiation_test.dart

Comment thread packages/stream_video/lib/src/call/call.dart
@Brazol
Brazol merged commit d0b3a62 into main Jul 17, 2026
20 checks passed
@Brazol
Brazol deleted the fix/fast-recon-improv branch July 17, 2026 08:02
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