Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit 5fd2622

Browse files
FCE-1891: joinRoom early return should resolve the promise (#475)
## Description While taking a shower tonight, it struck me that in this PR #474 I actually introduced a bug. The `joinRoom` promise should be rejected, instead of just returning the function. ## Motivation and Context There was a bug that might lead to errors (unresolved promise). ## How has this been tested? android + iOS ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist: - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. ## Screenshots (if appropriate)
1 parent 967069a commit 5fd2622

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react-native-client/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class RNFishjamClient(
299299
promise: Promise
300300
) {
301301
if (connectPromise != null || peerStatus == PeerStatus.Connected) {
302-
emitEvent(EmitableEvent.warning("Room already joined or it's connecting. You must call leaveRoom() before calling joinRoom() again."))
302+
promise.reject(JoinError("Room already joined or it's connecting. You must call leaveRoom() before calling joinRoom() again."))
303303
return
304304
}
305305

packages/react-native-client/ios/RNFishjamClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class RNFishjamClient: FishjamClientListener {
225225
promise: Promise
226226
) {
227227
guard connectPromise == nil && peerStatus != .connected else {
228-
emit(event: .warning(message: "Room already joined or it's connecting. You must call leaveRoom() before calling joinRoom() again."))
228+
promise.reject("E_MEMBRANE_CONNECT", "Room already joined or it's connecting. You must call leaveRoom() before calling joinRoom() again.")
229229
return
230230
}
231231

0 commit comments

Comments
 (0)