Fix rebuild

This commit is contained in:
John Livingston 2023-09-18 15:37:12 +02:00
parent 55fa6c0623
commit 65fd49a81c
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC

View File

@ -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 ?
}