Skip to content

Commit

Permalink
Stop the ICE disconnected timer on call terminate
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dbkr committed Feb 13, 2023
1 parent c67325b commit f346fcb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/webrtc/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2174,6 +2174,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
// chrome doesn't implement any of the 'onstarted' events yet
if (["connected", "completed"].includes(this.peerConn?.iceConnectionState ?? "")) {
clearTimeout(this.iceDisconnectedTimeout);
this.iceDisconnectedTimeout = undefined;
this.state = CallState.Connected;

if (!this.callLengthInterval && !this.callStartTime) {
Expand Down Expand Up @@ -2546,6 +2547,10 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
clearTimeout(this.inviteTimeout);
this.inviteTimeout = undefined;
}
if (this.iceDisconnectedTimeout !== undefined) {
clearTimeout(this.iceDisconnectedTimeout);
this.iceDisconnectedTimeout = undefined;
}
if (this.callLengthInterval) {
clearInterval(this.callLengthInterval);
this.callLengthInterval = undefined;
Expand Down

0 comments on commit f346fcb

Please sign in to comment.