Skip to content

Commit

Permalink
Setup signal callbacks before connecting signal (#832)
Browse files Browse the repository at this point in the history
* Setup signal callbacks before connecting signal

* Create tiny-brooms-roll.md
  • Loading branch information
lukasIO authored Aug 9, 2023
1 parent f7c4c96 commit cb38c46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tiny-brooms-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Setup signal callbacks before connecting signal
3 changes: 2 additions & 1 deletion src/room/RTCEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -206,7 +208,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
if (!this.subscriberPrimary) {
this.negotiate();
}
this.setupSignalClientCallbacks();

this.clientConfiguration = joinResponse.clientConfiguration;

Expand Down

0 comments on commit cb38c46

Please sign in to comment.