-
Notifications
You must be signed in to change notification settings - Fork 33
fix: disconnect from call when livekit disconnects #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for hoppdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe call-center component was refactored to properly handle room connection state changes. Event handlers for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)tauri/src/components/ui/call-center.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Comment |
konsalex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the logic is prone to errors, if not mistaken.
Here we periodically check participants, and if the backend loses the Redis connection for whatever reason for a brief moment the call will end 🤔
useEffect(() => {
if (!callTokens || !callParticipant) return;
if (!callParticipant.is_active) {
handleEndCall();
}
}, [callParticipant, teammates, callTokens, handleEndCall]);Thinking if this logic should also be more robust.
In the case of the bug, this can also be the case right?
An example flow I am thinking with some AI help:
Time Participant B Participant A
────────────────────────────────────────────────────────────────
t=0 Internet drops In call, seeing B
t=0.5 WebSocket closes
→ Redis channel gone
→ is_active = false
t=1-10 (Waiting for internet) Refetch teammates (every 10s)
Sees is_active=false
→ handleEndCall() ❌
t=3 Internet returns
WebSocket reconnects
→ is_active = true again
t=3+ LiveKit reconnects Already left the call
Still thinks call is active
And in this case, the participant B will not get a room disconnection event, as they were offline at that point in time if it happens?
Its a bit weird how we hanlde is_active now, and it will lead to this bug again? maybe I miss some context
Ends the call for our participants when the livekit participants disconnects. Closes #208
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.