From 8a5fa4d5c248ba9b8377c4d229910781c0f40195 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 3 Mar 2021 09:36:48 +0100 Subject: [PATCH] lib/client: reset state when websocket is closed --- lib/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/client.js b/lib/client.js index 332e1bd..eab180d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -74,6 +74,10 @@ export default class Client extends EventTarget { console.log("Connection closed"); this.ws = null; this.setStatus(Client.Status.DISCONNECTED); + this.availableCaps = {}; + this.enabledCaps = {}; + this.batches = new Map(); + this.pendingHistory = Promise.resolve(null); if (this.autoReconnect) { console.info("Reconnecting to server in " + RECONNECT_DELAY_SEC + " seconds");