-
Notifications
You must be signed in to change notification settings - Fork 240
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
event cache/timeline: reuse the Paginator
when running back-paginations
#3373
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
48bc7fe
event cache: reuse the paginator internally
bnjbvr 8862d00
event cache: move the `pagination_token_notifier` into the `RoomPagin…
bnjbvr 3ca4c98
event cache: introduce a `RoomPagination` API object and move code ar…
bnjbvr 2300253
event cache: remove "paginate" (et al.) in `RoomPagination` method names
bnjbvr bbd20b0
event_cache/timeline: have the event cache handle restarting a back-p…
bnjbvr b2070b0
Merge branch 'main' into bnjbvr/reuse-paginator-in-event-cache
bnjbvr cf01cb1
Address review comments
bnjbvr 3002389
Merge branch 'main' into bnjbvr/reuse-paginator-in-event-cache
bnjbvr 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
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.
Why? Do we want to dedup them? Maybe with
async_rx::StreamExt::dedup
if we can provide aStream
.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.
It's an implementation detail of
eyeball
that we're running into. If you have an emitter E and an observer O. Say E emits very quickly e1, e2, e3; then if O doesn't react fast enough, it may only see e1, handle it, and then miss e2, and only see e3.Before this PR, the exposed pagination status was controlled at the timeline level, and the timeline would make sure to reset it only when a full pagination loop is over, after we obtained e.g. N events.
After this PR, the pagination status is that of the underlying paginator. The timeline may continue to paginate after the paginator has run one pagination query. In that case, the underlying status of the paginator will be:
So the quick
running -> idle -> running
transition might make it so that an observer could seerunning -> running
, because they didn't react fast enough to see theidle
state in the middle.I've added a
dedup()
call to address this, thanks.Now, if the caller is actually fast enough, they may see a few quick transitions from
running -> idle -> running
; I wonder if that may cause some UI flickering (e.g. the spinner quickly disappears and reappears). At this point, both EX apps doesn't use the back-pagination status anymore, so it's a theoretical issue.