From c53a35deeb1917dec22a7691f3fd36cf4b4d125b Mon Sep 17 00:00:00 2001 From: Beaudan Date: Mon, 15 Jul 2019 12:37:40 +1000 Subject: [PATCH] Comment explaining stopPollingPromise --- js/modules/loki_message_api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/modules/loki_message_api.js b/js/modules/loki_message_api.js index dcd084695..5c98cc00e 100644 --- a/js/modules/loki_message_api.js +++ b/js/modules/loki_message_api.js @@ -255,6 +255,9 @@ class LokiMessageAPI { async openRetrieveConnection(stopPollingPromise, callback) { let stopPollingResult = false; + // When message_receiver restarts from onoffline/ononline events it closes + // http-resources, which will then resolve the stopPollingPromise with true. We then + // want to cancel these polling connections because new ones will be created // eslint-disable-next-line more/no-then stopPollingPromise.then(result => { stopPollingResult = result;