fix: prevent adding events to closed StreamController#978
fix: prevent adding events to closed StreamController#978rwrz wants to merge 1 commit intolivekit:mainfrom
Conversation
Add isClosed checks to DataStreamController's write() and error() methods to prevent "Bad state: Cannot add event after closing" exception. This error occurs when a participant disconnects and validateParticipantHasNoActiveDataStreams() tries to send errors to stream controllers that have already been closed. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
|
📝 WalkthroughWalkthroughThe DataStreamController's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (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). (7)
✏️ Tip: You can disable this entire section by setting 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 |
Add isClosed checks to DataStreamController's write() and error() methods to prevent "Bad state: Cannot add event after closing" exception.
This error occurs when a participant disconnects and validateParticipantHasNoActiveDataStreams() tries to send errors to stream controllers that have already been closed.
Summary by CodeRabbit