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

Enable room history to be shown immediately upon first opening a room #171

Conversation

kevinaboos
Copy link
Member

Move the logic for processing background timeline updates to a separate function, such that we can run that procedure the very first time a room is opened. If any updates were processed, we immediately redraw the timeline, which removes all visible latency that previously existed, as previously, a timeline wouldn't be redrawn until the first pagination response was received.

There is one exception to this, which is when a timeline is cleared. It still gets drawn properly, but since it's been cleared, there is nothing that actually gets drawn.
This problem requires a completely separate solution, e.g., not actually setting the existing TimelineUiState::items field to the new_items vector from the TimelineUpdate until another (or several more) pagination responses have been received and the timeline has been sufficiently backfilled.

Move the logic for processing background timeline updates to a
separate function, such that we can run that procedure the very first time
a room is opened. If any updates were processed, we immediately redraw
the timeline, which removes all visible latency that previously existed,
as previously, a timeline wouldn't be redrawn until the first pagination
response was received.

There is one exception to this, which is when a timeline is cleared.
It still gets drawn properly, but since it's been cleared, there is nothing
that actually gets drawn.
This problem requires a completely separate solution, e.g., not actually
setting the existing `TimelineUiState::items` field to the `new_items` vector
from the TimelineUpdate until another (or several more) pagination responses
have been received and the timeline has been sufficiently backfilled.
@kevinaboos kevinaboos merged commit df4f372 into project-robius:main Oct 2, 2024
1 check passed
@kevinaboos kevinaboos deleted the eagerly_process_timeline_updates_upon_first_view branch October 2, 2024 21:28
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.

1 participant