diff --git a/.changeset/cyan-dogs-know.md b/.changeset/cyan-dogs-know.md new file mode 100644 index 0000000000..3e9e8d19f2 --- /dev/null +++ b/.changeset/cyan-dogs-know.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Ensure handleDisconnect is called also when already in Reconnecting state diff --git a/src/room/RTCEngine.ts b/src/room/RTCEngine.ts index effe0912c3..8af239ad51 100644 --- a/src/room/RTCEngine.ts +++ b/src/room/RTCEngine.ts @@ -453,7 +453,7 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit } } else if (connectionState === PCTransportState.FAILED) { // on Safari, PeerConnection will switch to 'disconnected' during renegotiation - if (this.pcState === PCState.Connected) { + if (this.pcState === PCState.Connected || this.pcState === PCState.Reconnecting) { this.pcState = PCState.Disconnected; this.handleDisconnect(