fix(client): capture sessionId before await in updateLocalStreamState#2229
fix(client): capture sessionId before await in updateLocalStreamState#2229
Conversation
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR adds a pre-RPC abort check in the retryable helper, snapshots SFU sessionId before notifying mute state in Call.updateLocalStreamState and guards subsequent participant updates, and adds a test ensuring publish doesn't throw if sfuClient is cleared while an in-flight mute-state RPC completes. ChangesAbort Signal Handling and In-Flight RPC Safety
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
💡 Overview
Fixes a TOCTOU race in Call.updateLocalStreamState: this.sfuClient.sessionId is read after await this.notifyTrackMuteState(...), and a reconnect/leave during the await clears this.sfuClient, throwing on the destructure. Also drops the signal.aborted check in retryable so in-flight SFU RPCs can finish after the WebSocket is closed
📝 Implementation notes
🎫 Ticket: https://linear.app/stream/issue/XYZ-123
📑 Docs: https://github.com/GetStream/docs-content/pull/
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests