From 36a57b4007724ebec58b495ff0071c2d4b36fa9f Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 17 Jul 2019 10:49:26 +0200 Subject: [PATCH] Fix duplicate notifications n reconnect --- www/common/outer/mailbox.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/common/outer/mailbox.js b/www/common/outer/mailbox.js index 08e7b9351..e5397f7bc 100644 --- a/www/common/outer/mailbox.js +++ b/www/common/outer/mailbox.js @@ -245,8 +245,11 @@ proxy.mailboxes = { }); box.queue = []; }; + var lastReceivedHash; // Don't send a duplicate of the last known hash on reconnect box.onMessage = cfg.onMessage = function (msg, user, vKey, isCp, hash, author) { if (hash === m.lastKnownHash) { return; } + if (hash === lastReceivedHash) { return; } + lastReceivedHash = hash; try { msg = JSON.parse(msg); } catch (e) { @@ -364,6 +367,7 @@ proxy.mailboxes = { txid: txid, complete: true }, [req.cId]); + delete ctx.req[txid]; } }); };