call points for PeerCall.delay rely on AbortError actually being thrown

+ fix this in one call point where it wasn't the case
This commit is contained in:
Bruno Windels 2022-09-30 11:17:07 +02:00
parent 167a19a85b
commit 282cba0ff1

View File

@ -771,7 +771,8 @@ export class PeerCall implements IDisposable {
const {flushCandidatesLog} = this; const {flushCandidatesLog} = this;
// MSC2746 recommends these values (can be quite long when calling because the // MSC2746 recommends these values (can be quite long when calling because the
// callee will need a while to answer the call) // callee will need a while to answer the call)
await this.delay(this.direction === CallDirection.Inbound ? 500 : 2000); try { await this.delay(this.direction === CallDirection.Inbound ? 500 : 2000); }
catch (err) { return; }
this.sendCandidateQueue(flushCandidatesLog); this.sendCandidateQueue(flushCandidatesLog);
this.flushCandidatesLog = undefined; this.flushCandidatesLog = undefined;
} }
@ -1100,12 +1101,9 @@ export class PeerCall implements IDisposable {
const timeout = this.disposables.track(this.options.createTimeout(timeoutMs)); const timeout = this.disposables.track(this.options.createTimeout(timeoutMs));
try { try {
await timeout.elapsed(); await timeout.elapsed();
} catch (err) { } finally {
if (err.name !== "AbortError") { this.disposables.untrack(timeout);
throw err;
}
} }
this.disposables.untrack(timeout);
} }
private sendSignallingMessage(message: SignallingMessage<MCallBase>, log: ILogItem) { private sendSignallingMessage(message: SignallingMessage<MCallBase>, log: ILogItem) {