Skip to content

Commit e705c15

Browse files
authored
Ensure handleDisconnect is called also when already in Reconnecting state (#1671)
1 parent f37aaa9 commit e705c15

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/cyan-dogs-know.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-client": patch
3+
---
4+
5+
Ensure handleDisconnect is called also when already in Reconnecting state

src/room/RTCEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
453453
}
454454
} else if (connectionState === PCTransportState.FAILED) {
455455
// on Safari, PeerConnection will switch to 'disconnected' during renegotiation
456-
if (this.pcState === PCState.Connected) {
456+
if (this.pcState === PCState.Connected || this.pcState === PCState.Reconnecting) {
457457
this.pcState = PCState.Disconnected;
458458
this.fullReconnectOnNext = true;
459459
this.handleDisconnect(

0 commit comments

Comments
 (0)