Skip to content

Commit 4f12641

Browse files
authored
Ensure retries and restarts respect the singlePC setting (#1786)
1 parent d630657 commit 4f12641

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/room/RTCEngine.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
305305
this.logContext,
306306
);
307307
if (this.joinAttempts < this.maxJoinAttempts) {
308-
return this.join(url, token, opts, abortSignal);
308+
return this.join(url, token, opts, abortSignal, forceV0Path);
309309
}
310310
} else if (e.reason === ConnectionErrorReason.ServiceNotFound) {
311311
this.log.warn(`Initial connection failed: ${e.message} – Retrying`);
@@ -1100,7 +1100,13 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
11001100
throw new SignalReconnectError();
11011101
}
11021102
// in case a regionUrl is passed, the region URL takes precedence
1103-
joinResponse = await this.join(regionUrl ?? this.url, this.token, this.signalOpts);
1103+
joinResponse = await this.join(
1104+
regionUrl ?? this.url,
1105+
this.token,
1106+
this.signalOpts,
1107+
undefined,
1108+
!this.options.singlePeerConnection,
1109+
);
11041110
} catch (e) {
11051111
if (e instanceof ConnectionError && e.reason === ConnectionErrorReason.NotAllowed) {
11061112
throw new UnexpectedConnectionState('could not reconnect, token might be expired');

0 commit comments

Comments
 (0)