From 9688cabf36fe171a18d5c8b576f57e4638650ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 9 Jul 2019 19:27:44 +0200 Subject: [PATCH] Fix pending forced reconnection after WebSocket reconnection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the WebSocket is disconnected from the external signaling server it is automatically reconnected to it; if a forced reconnection with a new session was queued while the WebSocket was disconnected it was supposed to be performed as soon as it was reconnected. However, "_forceReconnect" tracks whether there is a pending forced reconnection, and as it was set to false when "Signaling.Standalone.connect()" was called the queued forced reconnection never happened after a WebSocket reconnection (which caused the previous session to be resumed instead of a new one being created). A forced reconnection with a new session is just a connection in which no previous session ID is given to resume it. Instead of queuing a forced reconnection now the session ID is cleared if forcing a reconnection when the socket is disconnected (just like when forcing a reconnection when the socket is connected), which fixes the issue described above and also causes the socket to already connect with the new session, instead of connecting with the previous one to then force the reconnection with the new one. "signalingRoomJoined" needs to be cleared too (like done in "sendBye") to properly wait to join the call after the reconnection was done. Signed-off-by: Daniel Calviño Sánchez --- js/signaling.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/signaling.js b/js/signaling.js index 4e86c7fa3..e839dfd40 100644 --- a/js/signaling.js +++ b/js/signaling.js @@ -867,6 +867,8 @@ } this._forceReconnect = true; + this.resumeId = null; + this.signalingRoomJoined = null; return; }