From 0eec84391fbea7b59fae332ebd580708dd8b627b Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 17 Mar 2021 10:53:36 -0700 Subject: [PATCH] MessageReceiver: Be resilient to failed updateCache call --- ts/textsecure/MessageReceiver.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index a544696b8062..525dc55b4d14 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -1095,7 +1095,12 @@ class MessageReceiverInner extends EventTarget { // Note: this is an out of band update; there are cases where the item in the // cache has already been deleted by the time this runs. That's okay. - this.updateCache(envelope, plaintext); + try { + this.updateCache(envelope, plaintext); + } catch (error) { + const errorString = error && error.stack ? error.stack : error; + window.log.error(`decrypt: updateCache failed: ${errorString}`); + } return plaintext; })