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

Fix various small regressions in the room list's behaviour #5070

Merged
merged 4 commits into from
Jul 31, 2020

Conversation

turt2live
Copy link
Member

Fixes element-hq/element-web#14798
Fixes element-hq/element-web#14799
Fixes element-hq/element-web#14782

This is reviewable commit-by-commit (highly recommended)

Fixes element-hq/element-web#14782

We need to check if the keys changed, not just the values.
Fixes element-hq/element-web#14799

We were checking to see if the tags were visible at render time, but we needed to ensure that they were(n't) included when checking for diffs. This introduces a new kind of object cloning for semantic reasons.

This also fixes the selection indicator being a bit off on custom tags.
Fixes element-hq/element-web#14798 (part 1)

When we transition from invite to not-invite we need to ensure we clear the invite notification state.
Fixes element-hq/element-web#14798 (part 2)

This is in two parts itself: The `RoomSublist` needs to break its references to the `RoomListStore`, so it now clones the room arrays. The `Algorithm` is the other part, which is slightly more complicated.

It turns out that we weren't handling splicing as a change in the `ImportanceAlgorithm`, therefore the `Algorithm` wasn't really feeling like it needed to change anything. Further, the `Algorithm` was using the wrong reference to where it should be dumping rooms (`this.cachedRooms` is a getter which returns a different object depending on conditions), so having fixed that we need to ensure that the filtered and sticky maps are also updated when we remove a room. Because we send the new tag through a Timeline update, we'll end up updating the tag later on and don't need to update the filter and sticky collections.
@turt2live turt2live added the X-Release-Blocker This affects the current release cycle and must be solved for a release to happen label Jul 30, 2020
@turt2live turt2live requested a review from a team July 30, 2020 21:26
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Thanks, all looks reasonable! 😄

@@ -136,6 +136,9 @@ export class ImportanceAlgorithm extends OrderingAlgorithm {
} else {
throw new Error(`Unhandled splice: ${cause}`);
}

// changes have been made if we made it here, so say so
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why wasn't that caught as a type error...?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because async :(

@jryans jryans merged commit 7629397 into develop Jul 31, 2020
@jryans
Copy link
Collaborator

jryans commented Jul 31, 2020

Merged now to ensure it's part of the upcoming RC.

@turt2live turt2live deleted the travis/room-list/regressions branch July 31, 2020 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
X-Release-Blocker This affects the current release cycle and must be solved for a release to happen
Projects
None yet
2 participants