From 9cd1f3f9349fc4e37f96d19be46cb76cfef0a1c2 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Mon, 3 Mar 2025 16:56:33 +0530 Subject: [PATCH] Explain intention in comment --- src/stores/room-list-v3/RoomListStoreV3.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stores/room-list-v3/RoomListStoreV3.ts b/src/stores/room-list-v3/RoomListStoreV3.ts index 417f4df413b..dbf35388fa4 100644 --- a/src/stores/room-list-v3/RoomListStoreV3.ts +++ b/src/stores/room-list-v3/RoomListStoreV3.ts @@ -85,6 +85,12 @@ export class RoomListStoreV3Class extends AsyncStoreWithClient { protected async onAction(payload: ActionPayload): Promise { if (!this.matrixClient || !this.roomSkipList?.initialized) return; + /** + * For the kind of updates that we care about (represented by the cases below), + * we try to find the associated room and simply re-insert it into the + * skiplist. If the position of said room in the sorted list changed, re-inserting + * would put it in the correct place. + */ switch (payload.action) { case "MatrixActions.Room.receipt": { if (readReceiptChangeIsFor(payload.event, this.matrixClient)) {