Thanks to visit codestin.com
Credit goes to github.com

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

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Apr 21, 2021

Fixes element-hq/element-web#16978

This was a mutable reference issue, but also unearthed another issue where a room gained its first tag and there was no lastEvent.

Unfortunately also uncovered another edge case behaviour in the RLS with local echoes, temporary workaround had to be brought back (removed in #5825 (comment))

@t3chguy t3chguy requested a review from a team April 21, 2021 07:56
// XXX: Room List Store has a bug where updates to the pre-filter during a local echo of a
// tags transition seem to be ignored, so refire in the next tick to work around it
setImmediate(() => {
this.emit(FILTER_CHANGED);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not too sure to understand the reason why we have to emit the FILTER_CHANGED event twice?
Could you give me a bit of extra context here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The comment above was hoping to cover it,

Without it the room list will ignore this prefilter update and use its internal local echo instead, causing the room to stay in Rooms until the next thing triggers the roomlist to recalculate.

This workaround already existed prior to #5825, that PR removed it assuming that it resolved all such cases, but it did not

Copy link
Contributor

@germain-gg germain-gg left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me! thanks

@t3chguy t3chguy merged commit 8373b0e into develop Apr 21, 2021
@t3chguy t3chguy deleted the t3chguy/fix/16978 branch April 21, 2021 09:30
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 in wrong space after being unfavorited
2 participants