fix: relax SFU leaveAndClose constraints - #1848
Merged
Merged
Conversation
oliverlaz
requested review from
Copilot,
kristian-mkd,
myandrienko and
santhoshvai
July 8, 2025 11:56
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR relaxes constraints in the leaveAndClose flow so that failures in the initial join task or notifying the SFU no longer prevent the call instance from being disposed.
- Moves
await this.joinTaskinside thetryblock to ensure join errors are caught. - Continues to catch and log errors from
notifyLeavewithout blocking disposal.
Comments suppressed due to low confidence (1)
packages/client/src/StreamSfuClient.ts:347
- Add unit tests that simulate failures in
joinTaskandnotifyLeaveto verify thatleaveAndClosehandles both errors gracefully and still allows disposal.
try {
santhoshvai
approved these changes
Jul 8, 2025
kristian-mkd
approved these changes
Jul 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Overview
Follow-up to #1846.
call.leave()throws an error after unrecoverable FAST reconnect.Our "leave" flow requires the client to announce its disconnect from the call to the SFU so the SFU can perform certain state cleanups faster. However, in the case described above, this isn't possible because the new SFU client never successfully connected to the SFU, and the signal WS was never established. This makes it impossible to send the announcement.
This PR adds better error handling and doesn't prevent the
callinstance disposal.🎫 Ticket: https://linear.app/stream/issue/RN-241/refresh-call-state-after-a-failed-reconnect