From d6b3083c2f16f55b1400be2d154e35b645c3c730 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 29 Mar 2018 18:18:53 +0100 Subject: [PATCH] Don't notify for bad encrypted messages Continue to wait for decryption if the decryption process failed. Because we weren't doing this, the first message in a megolm session was generally failing to decrypt the first time because the keys often arrive after the message. Fixes https://github.com/vector-im/riot-web/issues/6284 This is is small & safe enough that we may want to consider putting it in 0.14 if we're cutting another RC. --- src/Notifier.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Notifier.js b/src/Notifier.js index e69bdf4461..b823c4df05 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -256,6 +256,10 @@ const Notifier = { }, onEventDecrypted: function(ev) { + // 'decrypted' means the decryption process has finished: it may have failed, + // in which case it might decrypt soon if the keys arrive + if (ev.isDecryptionFailure()) return; + const idx = this.pendingEncryptedEventIds.indexOf(ev.getId()); if (idx === -1) return;