From cb38c46db2f07ae2016c04db26f666353fa7d919 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 9 Aug 2023 10:21:29 +0200 Subject: [PATCH] Setup signal callbacks before connecting signal (#832) * Setup signal callbacks before connecting signal * Create tiny-brooms-roll.md --- .changeset/tiny-brooms-roll.md | 5 +++++ src/room/RTCEngine.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/tiny-brooms-roll.md diff --git a/.changeset/tiny-brooms-roll.md b/.changeset/tiny-brooms-roll.md new file mode 100644 index 0000000000..4d12a9079c --- /dev/null +++ b/.changeset/tiny-brooms-roll.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Setup signal callbacks before connecting signal diff --git a/src/room/RTCEngine.ts b/src/room/RTCEngine.ts index 331c88576a..e4643356ef 100644 --- a/src/room/RTCEngine.ts +++ b/src/room/RTCEngine.ts @@ -193,6 +193,8 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit this.signalOpts = opts; try { this.joinAttempts += 1; + + this.setupSignalClientCallbacks(); const joinResponse = await this.client.join(url, token, opts, abortSignal); this._isClosed = false; this.latestJoinResponse = joinResponse; @@ -206,7 +208,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit if (!this.subscriberPrimary) { this.negotiate(); } - this.setupSignalClientCallbacks(); this.clientConfiguration = joinResponse.clientConfiguration;