mirror of https://github.com/vector-im/riot-web
Ensure incremental updates to the ImportanceAlgorithm trigger A-Z order
Fixes https://github.com/vector-im/riot-web/issues/14475 Background: Sticky rooms are actually a pair of lies to the underlying algorithm as a combination of REMOVE_ROOM/NEW_ROOM calls so they don't get considered as needing to be sorted. When a room is added under the importance algorithm, it is expected that the category it is being added to will be re-sorted to account for the change, however we weren't doing that since we optimized the NewRoom path to be a splice operation.pull/21833/head
parent
cbe4f04cd7
commit
6a38833a2b
|
@ -123,6 +123,7 @@ export class ImportanceAlgorithm extends OrderingAlgorithm {
|
|||
const category = this.getRoomCategory(room);
|
||||
this.alterCategoryPositionBy(category, 1, this.indices);
|
||||
this.cachedOrderedRooms.splice(this.indices[category], 0, room); // splice in the new room (pre-adjusted)
|
||||
await this.sortCategory(category);
|
||||
} else if (cause === RoomUpdateCause.RoomRemoved) {
|
||||
const roomIdx = this.getRoomIndex(room);
|
||||
if (roomIdx === -1) {
|
||||
|
|
Loading…
Reference in New Issue