From 31075d601fd6245aae20504f2b9fbaef2eeccd56 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 2 Jun 2021 15:06:30 +0200 Subject: [PATCH] load power levels before decryption closes the txn --- src/matrix/room/timeline/Timeline.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index cced535c..d6895312 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -63,6 +63,7 @@ export class Timeline { // as they should only populate once the view subscribes to it // if they are populated already, the sender profile would be empty + this._powerLevels = await this._loadPowerLevels(txn); // 30 seems to be a good amount to fill the entire screen const readerRequest = this._disposables.track(this._timelineReader.readFromEnd(30, txn, log)); try { @@ -71,7 +72,7 @@ export class Timeline { } finally { this._disposables.disposeTracked(readerRequest); } - this._powerLevels = await this._loadPowerLevels(txn); + // txn should be assumed to have finished here, as decryption will close it. } async _loadPowerLevels(txn) {