From 61757f94c8cd2786e36268d7321640cdce61e48b Mon Sep 17 00:00:00 2001 From: Andrew Bulat Date: Fri, 6 Sep 2024 17:19:53 +0100 Subject: [PATCH] Fix websocket reconnection can get stuck in disconnected/connecting cycle --- src/common/lib/transport/connectionmanager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/lib/transport/connectionmanager.ts b/src/common/lib/transport/connectionmanager.ts index 1e5316fdb..fc8275eb3 100644 --- a/src/common/lib/transport/connectionmanager.ts +++ b/src/common/lib/transport/connectionmanager.ts @@ -1450,8 +1450,6 @@ class ConnectionManager extends EventEmitter { if (transportPreference && transportPreference === this.baseTransport && this.webSocketTransportAvailable) { this.checkWsConnectivity() .then(() => { - this.wsCheckResult = true; - this.abandonedWebSocket = false; this.unpersistTransportPreference(); if (this.state === this.states.connecting) { Logger.logAction( @@ -1493,6 +1491,8 @@ class ConnectionManager extends EventEmitter { */ connectWs(transportParams: TransportParams, connectCount: number) { Logger.logAction(this.logger, Logger.LOG_MICRO, 'ConnectionManager.connectWs()'); + this.wsCheckResult = null; + this.abandonedWebSocket = false; this.startWebSocketSlowTimer(); this.startWebSocketGiveUpTimer(transportParams);