diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 6cf9225c..90db1b68 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -173,15 +173,15 @@ export class Session { changes.syncInfo = syncInfo; } if (this._deviceTracker) { - const deviceLists = syncResponse.device_lists; - if (deviceLists) { - await this._deviceTracker.writeDeviceChanges(deviceLists, txn); - } for (const {room, changes} of roomChanges) { if (room.isTrackingMembers && changes.memberChanges?.size) { await this._deviceTracker.writeMemberChanges(room, changes.memberChanges, txn); } } + const deviceLists = syncResponse.device_lists; + if (deviceLists) { + await this._deviceTracker.writeDeviceChanges(deviceLists, txn); + } } return changes; }