From a943467e7174a85abfef3772c39176ffcc598072 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Sep 2020 15:30:01 +0200 Subject: [PATCH] await txns --- src/matrix/e2ee/olm/Encryption.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/matrix/e2ee/olm/Encryption.js b/src/matrix/e2ee/olm/Encryption.js index f4731b25..e529fa13 100644 --- a/src/matrix/e2ee/olm/Encryption.js +++ b/src/matrix/e2ee/olm/Encryption.js @@ -85,7 +85,7 @@ export class Encryption { } async _findExistingSessions(devices) { - const txn = this._storage.readTxn([this._storage.storeNames.olmSessions]); + const txn = await this._storage.readTxn([this._storage.storeNames.olmSessions]); const sessionIdsForDevice = await Promise.all(devices.map(async device => { return await txn.olmSessions.getSessionIds(device.curve25519Key); })); @@ -195,7 +195,7 @@ export class Encryption { } async _loadSessions(encryptionTargets) { - const txn = this._storage.readTxn([this._storage.storeNames.olmSessions]); + const txn = await this._storage.readTxn([this._storage.storeNames.olmSessions]); // given we run loading in parallel, there might still be some // storage requests that will finish later once one has failed. // those should not allocate a session anymore. @@ -221,7 +221,7 @@ export class Encryption { } async _storeSessions(encryptionTargets, timestamp) { - const txn = this._storage.readWriteTxn([this._storage.storeNames.olmSessions]); + const txn = await this._storage.readWriteTxn([this._storage.storeNames.olmSessions]); try { for (const target of encryptionTargets) { const sessionEntry = createSessionEntry(