fix: prevent overlapping group call force rejoins#2406
Conversation
PR SummaryMedium Risk Overview The recovery flow is now
Reviewed by Cursor Bugbot for commit 71f567a. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 4ff45e3. Configure here.
4ff45e3 to
c243193
Compare
c243193 to
1b4a047
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2406 +/- ##
==========================================
+ Coverage 59.62% 59.70% +0.07%
==========================================
Files 161 161
Lines 20329 20342 +13
==========================================
+ Hits 12121 12145 +24
+ Misses 8208 8197 -11
Continue to review full report in Codecov by Harness.
|
51ad300 to
94442cb
Compare
When GroupCallSession.onMemberStateChanged() observed the local membership disappear while the call was still in entered, concurrent updates could trigger the force-rejoin path more than once before room state caught up. That led to repeated sendMemberStateEvent() and preShareKey() work, which could cascade into redundant key generation and unstable local participant state. This change extracts the recovery flow into _forceRejoin(), shares a single in-flight rejoin across concurrent callers, and clears the stale local participant cache before awaiting the resend path. The test coverage was also tightened with focused GroupCallSession regressions that prove both behaviors: stale local state is cleared until room state catches up, and concurrent updates do not start multiple force rejoins.
94442cb to
71f567a
Compare

When GroupCallSession.onMemberStateChanged() observed the local membership disappear while the call was still in entered, concurrent updates could trigger the force-rejoin path more than once before room state caught up. That led to repeated sendMemberStateEvent() and preShareKey() work, which could cascade into redundant key generation and unstable local participant state.
This change extracts the recovery flow into _forceRejoin(), shares a single in-flight rejoin across concurrent callers, and clears the stale local participant cache before awaiting the resend path.
The test coverage was also tightened with focused GroupCallSession regressions that prove both behaviors: stale local state is cleared until room state catches up, and concurrent updates do not start multiple force rejoins.