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

refactor event grouping into separate helper classes #4059

Merged
merged 3 commits into from
Feb 14, 2020

Conversation

uhoreg
Copy link
Member

@uhoreg uhoreg commented Feb 11, 2020

create a new grouper 🐟 class to encapsulate the grouping logic

@uhoreg uhoreg requested a review from a team February 11, 2020 20:22
@t3chguy
Copy link
Member

t3chguy commented Feb 11, 2020

Any chance of getting regression tests for this?

@uhoreg
Copy link
Member Author

uhoreg commented Feb 11, 2020

I'll try to do so. It looks like MELS already has a bunch of tests, so I just need to add tests for room creation/setup events.

@uhoreg
Copy link
Member Author

uhoreg commented Feb 13, 2020

test added. Ready for review now.

@t3chguy t3chguy requested review from t3chguy and removed request for a team February 14, 2020 09:51
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the tests, I'd argue that perhaps the grouper classes should get broken out but then they'd end up going far away due to them not being a component. This file could do with being shorter is all

@uhoreg uhoreg merged commit 4a204b7 into develop Feb 14, 2020
turt2live added a commit that referenced this pull request Feb 25, 2020
Fixes element-hq/element-web#12423

When events are redacted they fail to make it into the Grouper because the `shouldAddEvent` check blocks them from entering. However, the grouper expects that when `getTiles()` is called that there's events to group and dutifully grabs some context from the array. Because JavaScript is the least helpful language, `myArray[-1]` returns `undefined` or `null` and thus you get `cannot read 'sender' of undefined`.

Regressed in #4059
jryans added a commit that referenced this pull request Apr 3, 2020
The recent "groupers" which extracted out timeline grouping logic forgot to
pass through the last event state for read marker computation. This causes the
read marker to become visible when e.g. returning to room if it was last placed
inside a grouped set of events (currently room creation and membership events).

Regressed by #4059
Related to element-hq/element-web#12338
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.

2 participants