-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): Timeline
consumes updates as VectorDiff
s from the EventCache
#4408
Merged
Hywan
merged 21 commits into
matrix-org:main
from
Hywan:feat-ui-timeline-receive-vectordiff-2
Dec 20, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1e977d9
feat(ui): Add `TimelineBuilder::with_vectordiffs_as_inputs`.
Hywan 8a5fe2d
refactor(sdk): Add `RoomEventCacheUpdate::UpdateTimelineEvents`.
Hywan c48255d
feat(ui): Add blank `handle_remote_events_with_diffs`.
Hywan 07b5313
task(ui): Support `VectorDiff::Append` in `TimelineStateTransaction::…
Hywan 5a5ad77
task(ui): Support `VectorDiff::PushFront` in `TimelineStateTransactio…
Hywan 49d8a39
task(ui): Support `VectorDiff::PushBack` in `TimelineStateTransaction…
Hywan 07ed0b8
task(ui): Support `VectorDiff::Clear` in `TimelineStateTransaction::h…
Hywan c4da2eb
task(ui): Add `ObservableItems::insert_remote_event`.
Hywan f8f7443
task(ui): Add `AllRemoteEvents::range`.
Hywan e2a8441
task(ui): Support `VectorDiff::Insert` in `TimelineStateTransaction::…
Hywan 6ef9f73
task(ui): Support `VectorDiff::Remove,` in `TimelineStateTransaction:…
Hywan d928ef8
refactor(ui): Deduplicate remote events conditionnally.
Hywan 54877e9
task(ui): `DayDivider` has been renamed `DateDivider`.
Hywan 7385415
test(ui): Increase the `recursion_limit`.
Hywan 14597ed
fix(common): Use a trick to avoid hitting the `recursion_limit` too q…
Hywan a33efb8
refactor(ui): Deduplicate timeline items conditionnally.
Hywan c4becc2
refactor(ui): `Timeline` receives pagination events as `VectorDiff`s!
Hywan 1390a50
chore(ui): Make Clippy happy.
Hywan 0466742
feat(ui): Enable `TimelineSettings::vectordiffs_as_inputs` if event c…
Hywan c3094bb
refactor(sdk): Rename two variables.
Hywan 60fefdd
test: Increase timeout for codecoverage.
Hywan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventCache
, and that the EC would choose to emitAddTimelineItems
orUpdateTimelineItems
based on the feature flag? Otherwise, any other user of the event cache, that's not the timeline, has to implement the same filtering mechanism.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about this quite a lot too.
First off, this setting is temporary. It's gonna be removed as soon as we consider
RoomEventCacheUpdate::UpdateTimelineEvents
stable and we want to switch to it. The other variant,AddTimelineEvents
will be removed at the same time.Second, we have validated this approach during our team meeting :-p.
Third, while I share your concerns, putting the setting on the
EventCache
makes it so theTimeline
can receive both inputs at the same time (AddTimelineEvents
andUpdateTimelineEvents
), which can create a lot of confusion and inconsistent state.Fourth, this setting is used to decide if the
Timeline
has to apply its own deduplication mechanism or not:AddTimelineEvents
: yes, it has to,UpdateTimelineEvents: no, because it's expected to be handle by the
VectorDiff. Putting the settings on the
EventCachemakes it way more difficult for the
Timelineto decide. Actually, it requires a setting in the
Timeline` anyway.Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No: the idea is that, the EventCache would emit
AddTimelineEvents
if!feature_flag
, and emitUpdateTimelineEvents
iffeature_flag
, not both at the same time.Re: fourth, you're right the timeline would need to get this information; it's relatively trivial to add a getter on the feature flag in the event cache, and get the feature flag value from the
TimelineBuilder
.(Re: second, sometimes people change their mind when they realize they were wrong, and I definitely was when I validated it 😇)
Overall, I would even call for not having a feature flag at all, and remove the previous code entirely, but I understand that it's a big change, and it would be nice to test in isolation (especially before the EOY holidays). So my preference would be to have a feature flag on the EventCache, for consistency (it would also simplify code at the FFI layer, I suppose), but we can probably live with the feature flag on the Timeline, if you strongly prefer it.