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

Fetch previous messages in a more intelligent way #127

Merged
merged 3 commits into from
Mar 16, 2017

Conversation

KitsuneRal
Copy link
Member

The commit message says it all. Closes #94, #118

Deadline for reviews - 7 days (by Mar-16).

…w much to fetch

* getPreviousContent() won't be triggered during the model resetting; this should prevent unnecessary fetching reported in quotient-im#118.
* Previously we used a hard 5-pixel margin to check if it's time to scroll and fetched strictly 10 messages. This led to stuttering when scrolling far back the timeline, as reported in quotient-im#94. The new code calculates whether there are enough pixels above to scroll at the same speed for the nearest 2 seconds, and if not, fetches additional messages that would amount to about 3 additional seconds of scrolling (assuming that an average height of a fetched message in pixels will be the same as the average message height for the already loaded timeline).

Closes quotient-im#94, quotient-im#118
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@KitsuneRal KitsuneRal merged commit 3ff3e40 into quotient-im:master Mar 16, 2017
@KitsuneRal KitsuneRal deleted the lazy-get-previous-messages branch March 16, 2017 03:28
nicolasfella pushed a commit to nicolasfella/Quaternion that referenced this pull request Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Version 0.0.4 - Released
Development

Successfully merging this pull request may close these issues.

2 participants