From 10003e7d3acc0532b57575ca541f69761a2bf7a0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Mar 2021 22:30:45 +0100 Subject: [PATCH] also sync room not in the rooms section but with new room keys --- src/matrix/Sync.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/matrix/Sync.js b/src/matrix/Sync.js index 9e8f7997..05c1d138 100644 --- a/src/matrix/Sync.js +++ b/src/matrix/Sync.js @@ -257,6 +257,20 @@ export class Sync { response, sessionState.lock, prepareTxn, log)); const newKeysByRoom = sessionState.preparation?.newKeysByRoom; + + // add any rooms with new keys but no sync response to the list of rooms to be synced + if (newKeysByRoom) { + const {hasOwnProperty} = Object.prototype; + for (const roomId of newKeysByRoom.keys()) { + const isRoomInResponse = response.rooms?.join && hasOwnProperty.call(response.rooms.join, roomId); + if (!isRoomInResponse) { + let room = this._session.rooms.get(roomId); + if (room) { + roomStates.push(new RoomSyncProcessState(room, {}, room.membership)); + } + } + } + } await Promise.all(roomStates.map(async rs => { const newKeys = newKeysByRoom?.get(rs.room.id);