From f9156dd47c21b190d51d8d87134c9209e0fcc8db Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sun, 9 Jun 2024 00:22:40 +0200 Subject: [PATCH] Fixed silent disconnect of Etherpad --- src/static/js/pad.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index ef13312a5..8e34e3b36 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -251,7 +251,11 @@ const handshake = async () => { // The socket.io client will automatically try to reconnect for all reasons other than "io // server disconnect". console.log(`Socket disconnected: ${reason}`) - if (reason !== 'io server disconnect' || reason !== 'ping timeout') return; + if (!reason.includes("close") && !reason.includes("transport error")) { + console.error("Unknown socket disconnect", reason) + return; + } + console.log("Reconnecting") socketReconnecting(); socket.connect(); });