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

feat(event cache): start paginations from the most recent token, not the oldest token #4393

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Dec 9, 2024

Part of #3280. See the first commit message's description to get the reasoning.

Split from #4308.

@bnjbvr bnjbvr requested a review from a team as a code owner December 9, 2024 13:43
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team December 9, 2024 13:43
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.19%. Comparing base (a1a04ee) to head (55dae88).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4393      +/-   ##
==========================================
+ Coverage   85.16%   85.19%   +0.02%     
==========================================
  Files         281      281              
  Lines       30924    30926       +2     
==========================================
+ Hits        26337    26347      +10     
+ Misses       4587     4579       -8     

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

Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

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

Great write-up in the parent issue, thank you.

Looks good.

…e *oldest* one

Whenever it needs to back-paginate, the event cache should start with
the *most recent* backpagination token, not the oldest one.

This isn't a functional change, until the persistent storage is enabled.
The reason is that, currently, there is one previous-batch token alive;
after it's used, it's replaced with another gap and the events it served
to request from the server.

When persistent storage will be enabled, we'll have situations like the
one shown in the test code, where we can have multiple previous-batch
token alive at the same time. In that case, we'll need to back-paginate
from the most recent events to the least recent events, and not the
other way around, or we'll have holes in the timeline that won't be
filled until we got to the start of the timeline.
@bnjbvr bnjbvr force-pushed the bnjbvr/most-recent-prevbatch-token branch from 9d9d649 to 55dae88 Compare December 9, 2024 14:35
@bnjbvr bnjbvr enabled auto-merge (rebase) December 9, 2024 14:37
@bnjbvr bnjbvr merged commit e402ed4 into main Dec 9, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/most-recent-prevbatch-token branch December 9, 2024 14:57
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.

2 participants