Skip to content
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

timeline: after an event cache update lag, fetch previous events back from the cache #3345

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Apr 19, 2024

Fixes #3311.

When the timeline is lagging behind the event cache, it should not only clear what it contains (because it may be lagging some information coming from the event cache), it should also retrieve the events the cache knows about, and adds them as if they were "initial" events.

This makes sure that the event cache's events and the timeline's events are always the same, and that, in the case of a lag, there won't be any missing chunks (caused by the event cache back-pagination being further away in the past, than what's displayed in the timeline).

The lag behind a bit too hard to reproduce, I've not included a test here; but I think this should be the right move.

@bnjbvr bnjbvr requested a review from Hywan April 19, 2024 13:31
@bnjbvr bnjbvr requested a review from a team as a code owner April 19, 2024 13:31
… from the cache

Fixes #3311.

When the timeline is lagging behind the event cache, it should not only
clear what it contains (because it may be lagging some information
coming from the event cache), it should also retrieve the events the
cache knows about, and adds them as if they were "initial" events.

This makes sure that the event cache's events and the timeline's events
are always the same, and that, in the case of a lag, there won't be any
missing chunks (caused by the event cache back-pagination being further
away in the past, than what's displayed in the timeline).

The lag behind a bit too hard to reproduce, I've not included a test
here; but I think this should be the right move.
@bnjbvr bnjbvr force-pushed the bnjbvr/add-events-after-clear-upon-lag-timeline branch from 45bbda8 to 712ecf5 Compare April 19, 2024 13:32
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 83.62%. Comparing base (1f524f2) to head (712ecf5).
Report is 4 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-ui/src/timeline/builder.rs 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3345      +/-   ##
==========================================
- Coverage   83.63%   83.62%   -0.02%     
==========================================
  Files         241      241              
  Lines       24881    24896      +15     
==========================================
+ Hits        20809    20819      +10     
- Misses       4072     4077       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bnjbvr bnjbvr merged commit 4398052 into main Apr 22, 2024
35 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/add-events-after-clear-upon-lag-timeline branch April 22, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[timeline/event-cache] a timeline clear should cause a cached events read from the event cache
2 participants