Skip to content

Commit f346fcb

Browse files
committed
Stop the ICE disconnected timer on call terminate
It just wasn't getting stopped, so if the call ended while ICE was disconnected, we'd get confusing error messages after the call ended.
1 parent c67325b commit f346fcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/webrtc/call.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2174,6 +2174,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
21742174
// chrome doesn't implement any of the 'onstarted' events yet
21752175
if (["connected", "completed"].includes(this.peerConn?.iceConnectionState ?? "")) {
21762176
clearTimeout(this.iceDisconnectedTimeout);
2177+
this.iceDisconnectedTimeout = undefined;
21772178
this.state = CallState.Connected;
21782179

21792180
if (!this.callLengthInterval && !this.callStartTime) {
@@ -2546,6 +2547,10 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
25462547
clearTimeout(this.inviteTimeout);
25472548
this.inviteTimeout = undefined;
25482549
}
2550+
if (this.iceDisconnectedTimeout !== undefined) {
2551+
clearTimeout(this.iceDisconnectedTimeout);
2552+
this.iceDisconnectedTimeout = undefined;
2553+
}
25492554
if (this.callLengthInterval) {
25502555
clearInterval(this.callLengthInterval);
25512556
this.callLengthInterval = undefined;

0 commit comments

Comments
 (0)