From 4401012312260c0758906aa739d4de6cec3229cc Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Sep 2020 15:30:54 +0200 Subject: [PATCH] no need to call decrypt when there are no events --- src/matrix/DeviceMessageHandler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/matrix/DeviceMessageHandler.js b/src/matrix/DeviceMessageHandler.js index 9c81f11e..537b948d 100644 --- a/src/matrix/DeviceMessageHandler.js +++ b/src/matrix/DeviceMessageHandler.js @@ -64,6 +64,9 @@ export class DeviceMessageHandler { } const readTxn = await this._storage.readTxn([this._storage.storeNames.session]); const pendingEvents = await this._getPendingEvents(readTxn); + if (pendingEvents.length === 0) { + return; + } // only know olm for now const olmEvents = pendingEvents.filter(e => e.content?.algorithm === OLM_ALGORITHM); const decryptChanges = await this._olmDecryption.decryptAll(olmEvents);