Fixed silent disconnect of Etherpad

This commit is contained in:
SamTV12345 2024-06-09 00:22:40 +02:00
parent 404ffde232
commit f9156dd47c

View file

@ -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();
});