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: reset pagination status if a live back-pagination is aborted #3365

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Apr 30, 2024

Repetition of #3359 but at a different layer: the timeline has its own observable state for a back-pagination status, and we should also reset it when using back-pagination on a live timeline.

Instead of doing this, we should probably have the status + the pagination being handled in the event cache, using the new Paginator API, but that's a bigger change that I'm working on, and it changes many many public APIs related to the event cache, so I'm slightly postponing that and instead I propose to get this simpler fix merged.

Part of #3355.

@bnjbvr bnjbvr requested a review from a team as a code owner April 30, 2024 13:30
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team April 30, 2024 13:30
Copy link
Contributor

@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.

Looks good, one suggestion. Thanks!

}

impl ResetStatusGuard {
fn new(status: SharedObservable<PaginationStatus>, target: PaginationStatus) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why target is the first argument here: https://github.com/matrix-org/matrix-rust-sdk/pull/3359/files#diff-a6ab59f890b91b82d1648c9c8bbd78c6387ece6d89f8a30683fe941be504628eR147 and the second in this code?

If not, I'd recommend keeping the order consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no reason, so you're right, we should make it consistent. I slightly prefer state first, then target, so I'll switch the other one around. Thanks!

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.49%. Comparing base (dc2b9ed) to head (5eb10a3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3365   +/-   ##
=======================================
  Coverage   83.48%   83.49%           
=======================================
  Files         243      243           
  Lines       25052    25060    +8     
=======================================
+ Hits        20915    20924    +9     
+ Misses       4137     4136    -1     

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

@bnjbvr bnjbvr force-pushed the bnjbvr/interrupting-backpagination-timeline branch from 3a10489 to 5eb10a3 Compare April 30, 2024 13:55
@bnjbvr bnjbvr enabled auto-merge (rebase) April 30, 2024 13:56
@bnjbvr bnjbvr merged commit 177e31c into main Apr 30, 2024
35 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/interrupting-backpagination-timeline branch April 30, 2024 14:10
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