From f18520a2fe2da30a3c4028be00d98c60467cec1a Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:39:50 +0200 Subject: [PATCH] let loadMembers use own txn in case members haven't been fetched yet if they haven't, it will need a network request, meaning that the txn will get closed, so we can't reuse it afterwards --- src/matrix/e2ee/DeviceTracker.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/matrix/e2ee/DeviceTracker.js b/src/matrix/e2ee/DeviceTracker.js index edf3c133..55051994 100644 --- a/src/matrix/e2ee/DeviceTracker.js +++ b/src/matrix/e2ee/DeviceTracker.js @@ -116,13 +116,12 @@ export class DeviceTracker { if (room.isTrackingMembers || !room.isEncrypted) { return; } + const memberList = await room.loadMemberList(undefined, log); const txn = await this._storage.readWriteTxn([ this._storage.storeNames.roomSummary, this._storage.storeNames.userIdentities, ]); - let memberList; try { - memberList = await room.loadMemberList(txn, log); let isTrackingChanges; try { isTrackingChanges = room.writeIsTrackingMembers(true, txn); @@ -140,7 +139,7 @@ export class DeviceTracker { await txn.complete(); room.applyIsTrackingMembersChanges(isTrackingChanges); } finally { - memberList?.release(); + memberList.release(); } }