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

unable to load toots in the middle of the timeline #399

Closed
fardog opened this issue Oct 19, 2017 · 3 comments · Fixed by #435
Closed

unable to load toots in the middle of the timeline #399

fardog opened this issue Oct 19, 2017 · 3 comments · Fixed by #435
Labels
Milestone

Comments

@fardog
Copy link

fardog commented Oct 19, 2017

when tusky is restored from a previous session, new toots commonly will not load automatically. on a pull-to-refresh, it fetches the latest 40 or so toots, and prepends them to the top of the list. it seems to be impossible to load toots between the newly loaded ones, and the ones from a previous session, leaving an unclosable gap in the timeline.

to reproduce

  1. open tusky
  2. allow toots to load
  3. switch apps so tusky is no longer focused, come back after more toots than the fetch amount (40 or so? i'm guessing) have been made
  4. scroll to the top of the timeline, pull to refresh
  5. scroll past the newly loaded toots

observed behavior

there is no division between old and new toots. they are part of a contiguous timeline without the option to load those that are in the gap.

desired behavior

a division between the old and new toots would be shown, with an option to load those that are in the gap

@connyduck connyduck added the bug label Oct 19, 2017
@charlag
Copy link
Collaborator

charlag commented Oct 19, 2017

@fardog thanks for such a detailed reproduction instructions! I have been noticing this bug as well but I wasn't sure how to reproduce it.

@connyduck connyduck added this to the Tusky 1.3.0 milestone Oct 19, 2017
@charlag
Copy link
Collaborator

charlag commented Oct 28, 2017

I've looked into this and it seems like it's not easy. We need another cell to signify the "gap" and it will shift everything below it by one.
We also have to keep track of what we have loaded and what not.
The only easy solution I see now is to drop everything below new toots if ends didn't meet.

@connyduck
Copy link
Collaborator

So here is what i am going to attempt. This should also solve #89

  • have a special status that marks "here is a part of the timeline missing". The adapter renders it as a button to load the missing part. Needs some logic to determine whether there are missing statuses between old and newly loaded ones. Looking at the Link header may help.
  • implement saving statuses to database
  • when exiting the app, save all statuses from the currently visible up to the newest to database, including the special statuses
  • save currently visible position in shared preferences
  • when reopening the app, recreate the state from shared preferences and database

Yes this will take some time. I will probably need loads of async stuff and some kind of cache management that cleans old statuses from the database. But the user experience should then be much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants