From 3ff91639c682b1f0746cfad0ba4fc4f0bc01416c Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:07:16 +0100 Subject: [PATCH 1/2] log signalingState on negotiationneeded --- src/matrix/calls/PeerCall.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/calls/PeerCall.ts b/src/matrix/calls/PeerCall.ts index 2b28fbef..a4ea984d 100644 --- a/src/matrix/calls/PeerCall.ts +++ b/src/matrix/calls/PeerCall.ts @@ -165,7 +165,7 @@ export class PeerCall implements IDisposable { }); listen("negotiationneeded", () => { const promiseCreator = () => { - return logItem.wrap("onNegotiationNeeded", log => { + return logItem.wrap({l: "onNegotiationNeeded", signalingState: this.peerConnection.signalingState}, log => { return this.handleNegotiation(log); }); }; From 5ad3f0c6712cac4f53ab7f1305fb38cce450d0d1 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:11:35 +0100 Subject: [PATCH 2/2] look at signalingState when even is fired, not later when it may have changed --- src/matrix/calls/PeerCall.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/matrix/calls/PeerCall.ts b/src/matrix/calls/PeerCall.ts index a4ea984d..dc85084a 100644 --- a/src/matrix/calls/PeerCall.ts +++ b/src/matrix/calls/PeerCall.ts @@ -164,8 +164,9 @@ export class PeerCall implements IDisposable { }); }); listen("negotiationneeded", () => { + const signalingState = this.peerConnection.signalingState; const promiseCreator = () => { - return logItem.wrap({l: "onNegotiationNeeded", signalingState: this.peerConnection.signalingState}, log => { + return logItem.wrap({l: "onNegotiationNeeded", signalingState}, log => { return this.handleNegotiation(log); }); };