From c7cea7fae3682f55b8c71f9afd3bfcb81455d12f Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 9 Sep 2019 15:56:01 +0200 Subject: [PATCH] identify cause of 'channel ready without callback' and handle reconnection more gracefully --- www/common/common-messenger.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/common/common-messenger.js b/www/common/common-messenger.js index 1210e652f..be4fa9aa2 100644 --- a/www/common/common-messenger.js +++ b/www/common/common-messenger.js @@ -728,6 +728,15 @@ define([ network.on('reconnect', function () { if (channel && channel.stopped) { return; } if (!channels[data.channel]) { return; } + + if (!joining[data.channel]) { + joining[data.channel] = function () { + console.log("reconnected to %s", data.channel); + }; + } else { + console.error("Reconnected to a chat channel (%s) which was not fully connected", data.channel); + } + network.join(data.channel).then(onOpen, function (err) { console.error(err); });