From 65fd49a81cde11d60d1491ac92094fbdfa4380b4 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Mon, 18 Sep 2023 15:37:12 +0200 Subject: [PATCH] Fix rebuild --- server/lib/room-channel/room-channel-class.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/lib/room-channel/room-channel-class.ts b/server/lib/room-channel/room-channel-class.ts index 28d77c79..a0d50c49 100644 --- a/server/lib/room-channel/room-channel-class.ts +++ b/server/lib/room-channel/room-channel-class.ts @@ -256,13 +256,20 @@ class RoomChannel { data[channelId].push(room.localpart) } - // This part must be done atomicly: - this._readData(data) - + // ************ ATOMIC PART **************** + // The rebuild process can remove some rooms (for example if prosody-room-type is changed), + // So we must mark all previous rooms as to refresh: // Now we must mark all rooms for conf update. for (const roomJID of this.room2Channel.keys()) { this.roomConfToUpdate.set(roomJID, true) } + // This part must be done atomicly: + this._readData(data) + // Now we must mark all rooms for conf update. + for (const roomJID of this.room2Channel.keys()) { + this.roomConfToUpdate.set(roomJID, true) + } + // ************ END OF ATOMIC PART **************** await this.sync() // FIXME: or maybe scheduleSync ? }