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

Fix room list sorting woes #4164

Closed
wants to merge 1 commit into from
Closed

Fix room list sorting woes #4164

wants to merge 1 commit into from

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Mar 3, 2020

this resolves to regenerating the lists whenever _slotRoomIntoList breaks. Better solution would be to apply something along the lines of element-hq/element-web#11743 but this needs a product meeting on exactly what we want out of the room list in terms of behaviour, "sticky room" I'm looking at you.

Fixes element-hq/element-web#12588

@t3chguy t3chguy requested a review from a team March 3, 2020 14:22
@turt2live turt2live changed the title fix room list sorting woes Fix room list sorting woes Mar 3, 2020
@@ -527,20 +544,19 @@ class RoomListStore extends Store {
room, category, key, this._state.lists[key], listsClone[key], lastTimestamp);

if (!pushedEntry) {
// This should rarely happen: _slotRoomIntoList has several checks which attempt
// XXX: This should rarely happen: _slotRoomIntoList has several checks which attempt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not an XXX, it's an actual feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also probably want to keep the "insert at the top to get a bug report" bits, as generating the initial room lists masks the problem.

// We insert our own record as needed, so don't let the old one through.
if (entry.room.roomId === room.roomId) {
continue;
if (existingIndex === null && entry.room.roomId === room.roomId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably where your duplication is happening: multiple copies of a room can be sent through this function, which is why it does an early filter rather than selective removal.

@turt2live
Copy link
Member

@t3chguy I've stolen about half of this PR and opened it as #4175 - see PR description for slightly more info. Closing this in favour of that.

Sorry this area of Riot is an Experience™ :(

@turt2live turt2live closed this Mar 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Room list does not reorder on new messages
2 participants