-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: allow reusing call instances after leaving #1433
Conversation
|
||
this.dispatcher.offAll(); |
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.
🍓 Not removing listeners from dispatcher.
That seems to be safe, since every object keeping a reference to a dispatcher (except for the call itself) is nullified on leave. So the call instance will be GC-ed properly even without offAll
.
this.camera = new CameraManager(this); | ||
this.microphone = new MicrophoneManager(this); | ||
this.speaker = new SpeakerManager(this); | ||
this.screenShare = new ScreenShareManager(this); | ||
} | ||
|
||
private async setup() { | ||
await withoutConcurrency(this.joinLeaveConcurrencyTag, async () => { |
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.
Prevents a race condition with leave
. It's important to wait for leave
to finish before we set everything back up again. See the test case here: https://github.com/GetStream/stream-video-js/pull/1433/files#diff-912706ed8d680e55d746f9765aa5090d64771196a9894262bed3e0b73d9a8c97R92-R110
🚂 #1433 Removes a guard preventing joining left calls.
No description provided.