From 2943cb525f6ba83334b0ab4c6c89cefca0808141 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 22 Oct 2021 17:50:45 +0200 Subject: [PATCH] add comment about possible future optimization --- src/matrix/room/Room.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/matrix/room/Room.js b/src/matrix/room/Room.js index cab0e13b..a0d7c693 100644 --- a/src/matrix/room/Room.js +++ b/src/matrix/room/Room.js @@ -76,6 +76,10 @@ export class Room extends BaseRoom { let eventsToDecrypt = roomResponse?.timeline?.events || []; // when new keys arrive, also see if any older events can now be retried to decrypt if (newKeys) { + // TODO: if a key is considered by roomEncryption.prepareDecryptAll to use for decryption, + // key.eventIds will be set. We could somehow try to reuse that work, but retrying also needs + // to happen if a key is not needed to decrypt this sync or there are indeed no encrypted messages + // in this sync at all. retryEntries = await this._getSyncRetryDecryptEntries(newKeys, roomEncryption, txn); if (retryEntries.length) { log.set("retry", retryEntries.length);