Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2761 from matrix-org/dbkr/rls-debugging
Browse files Browse the repository at this point in the history
Include tag name when warning about rooms running off lists
  • Loading branch information
dbkr authored Mar 6, 2019
2 parents 5c0c2fa + ff72c3b commit 0b0b16d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stores/RoomListStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class RoomListStore extends Store {
return tags;
}

_slotRoomIntoList(room, category, existingEntries, newList, lastTimestampFn) {
_slotRoomIntoList(room, category, tag, existingEntries, newList, lastTimestampFn) {
const targetCategoryIndex = CATEGORY_ORDER.indexOf(category);

// The slotting algorithm works by trying to position the room in the most relevant
Expand Down Expand Up @@ -430,7 +430,7 @@ class RoomListStore extends Store {
}

if (!pushedEntry && desiredCategoryBoundaryIndex >= 0) {
console.warn(`!! Room ${room.roomId} nearly lost: Ran off the end of the list`);
console.warn(`!! Room ${room.roomId} nearly lost: Ran off the end of ${tag}`);
console.warn(`!! Inserting at position ${desiredCategoryBoundaryIndex} with category ${category}`);
newList.splice(desiredCategoryBoundaryIndex, 0, {room, category});
pushedEntry = true;
Expand Down Expand Up @@ -481,7 +481,7 @@ class RoomListStore extends Store {
listsClone[key] = [];

const pushedEntry = this._slotRoomIntoList(
room, category, this._state.lists[key], listsClone[key], lastTimestamp);
room, category, key, this._state.lists[key], listsClone[key], lastTimestamp);

if (!pushedEntry) {
// This should rarely happen: _slotRoomIntoList has several checks which attempt
Expand Down

0 comments on commit 0b0b16d

Please sign in to comment.