fix(llc): call accept race fix#1258
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthrough
Optimistic call acceptance
Sequence Diagram(s)sequenceDiagram
participant UI as UI
participant Call as Call.accept()
participant State as lifecycleCallAccepted
participant Coord as CoordinatorClient
participant WS as Coordinator event handling
UI->>Call: accept()
Call->>State: lifecycleCallAccepted()
Call->>Coord: acceptCall(cid)
Note over WS: call.accepted event may arrive while HTTP is in flight
WS->>State: read acceptedByMe=true
alt coordinator success
Coord-->>Call: Success
else coordinator failure
Coord-->>Call: Failure
Call->>State: lifecycleCallAccepted(accepted: false)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 906-909: The unconditional rollback on any Failure at line 906 is
too broad and can cause false rejection states. When a transport-level failure
occurs after the server has accepted the call, reverting acceptedByMe to false
via _stateManager.lifecycleCallAccepted(accepted: false) at line 908 can cause
_handleCoordinatorCallAccepted to incorrectly trigger the "accepted on another
device" logic again. Instead of reverting on all Failure results, classify the
error to distinguish between definitive rejections from the server versus
transport-level failures, and only perform the rollback for specific error types
that represent clear non-acceptance outcomes. This ensures that optimistic
acceptance is only reverted when we have definitive evidence the server did not
accept the call.
🪄 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: 2769b017-d45a-48f6-a079-4198e58ef51b
📒 Files selected for processing (2)
packages/stream_video/lib/src/call/call.dartpackages/stream_video/lib/src/call/state/mixins/state_lifecycle_mixin.dart
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1258 +/- ##
========================================
+ Coverage 9.66% 9.68% +0.02%
========================================
Files 676 676
Lines 49689 49690 +1
========================================
+ Hits 4801 4812 +11
+ Misses 44888 44878 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #1254
Summary by CodeRabbit