Skip to content

fix: relax SFU leaveAndClose constraints - #1848

Merged
oliverlaz merged 1 commit into
mainfrom
relaxed-leave-request
Jul 8, 2025
Merged

fix: relax SFU leaveAndClose constraints#1848
oliverlaz merged 1 commit into
mainfrom
relaxed-leave-request

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

💡 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 call instance disposal.

🎫 Ticket: https://linear.app/stream/issue/RN-241/refresh-call-state-after-a-failed-reconnect

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.joinTask inside the try block to ensure join errors are caught.
  • Continues to catch and log errors from notifyLeave without blocking disposal.
Comments suppressed due to low confidence (1)

packages/client/src/StreamSfuClient.ts:347

  • Add unit tests that simulate failures in joinTask and notifyLeave to verify that leaveAndClose handles both errors gracefully and still allows disposal.
    try {

Comment thread packages/client/src/StreamSfuClient.ts
@oliverlaz
oliverlaz merged commit dbf8bb0 into main Jul 8, 2025
16 checks passed
@oliverlaz
oliverlaz deleted the relaxed-leave-request branch July 8, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants