Tusky icon indicating copy to clipboard operation
Tusky copied to clipboard

"Show more" loading the timeline jumps the timeline location to the wrong place

Open fin-w opened this issue 1 year ago • 22 comments

Detailed description

It looks to me like the timeline location logic goes wrong somewhere when loading in more posts with a "load more" button.

If you have loaded in posts 0 to 100 and 150 to 200, there will be a gap 100-150 filled by the "load more" button. But when you click that button, while the correct posts are immediately displayed on screen i.e. new posts show in place of the "show more" button, any scrolling up / down loads posts as though the timeline position were somewhere up in 0-100 (I don't know how to be more exact than that sorry). Once you scroll up / down a full screen, no posts in the timeline are from your original position where the "load more" button was and the timeline only shows posts from the 0-100 region. It's like you've jumped position. You can scroll back down to your place in the timeline and everything seems fine. Loading more posts with another button causes the same issue but I think a different timeline place is jumped to.

This has been happening with the last few Tusky Test builds, probably since #4471 or possibly earlier?

Steps to reproduce the problem

  1. Sleep
  2. Wake up and check the fedi- there are lots of new posts on the home timeline
  3. Click a "load more" button to load / insert posts somewhere between cached posts. Currently viewed posts will not change, near the bottom of the screen new posts will be visible
  4. Scroll up or down- the posts loaded in from being out of view are from a different location in the timeline (from further up / more recent, that were [I think] already cached)

Debug information

Tusky Test 25.2-8aaca3bb

Device: motorola moto g(7) power Fersiwn Android: 14 Fersiwn SDK: 34

fin-w avatar Jun 04 '24 12:06 fin-w

It doesn't happen every time...

fin-w avatar Jun 04 '24 12:06 fin-w

When a jump does happen, the time of posting on visible posts switches to the time of posting on the post that is jumped to, i.e. where a post at your original position was posted 5h ago, after clicking "load more" it might display 4h ago immediately, and then after scrolling away and back will fully display the post from 4h ago, that is further up the timeline, that Tusky has replaced the original post with. So there's partial loading of data from elsewhere in the timeline, from the point posts load after clicking 'load more".

fin-w avatar Jun 04 '24 12:06 fin-w

Are you sure this happens with build after #4471? Because that should be fixed there and I can't reproduce it anymore.

connyduck avatar Jun 12 '24 15:06 connyduck

Hmm, I haven't been able to trigger it on the latest build (Tusky Test 25.2-4afce0a3) so perhaps it's gone, like you say?

fin-w avatar Jun 12 '24 22:06 fin-w

Okay something probably related happened: Load Tusky after leaving it for hours, load Home timeline, timeline will show a section of newly-loaded posts, a 'load more' button, and the old posts below. Use the load more button once or twice, then scroll to the top. Then scroll down and open a post's CW that was closed (can't remember if the post was in newly-loaded or old posts). Instead of opening the post CW, Tusky jumped me up into the newly-loaded posts. I'm trying to keep an eye out for timeline inconsistencies, and prior to opening the CW, the timeline was functioning completely normally.

fin-w avatar Jun 13 '24 10:06 fin-w

On Tusky Test 25.2-9fff8d19 it didn't do any of the aforementioned behaviours, however, I just opened the app after some time, and pressed Load More until the button went away (presumably because there were no posts not yet loaded), and got a weird behaviour.

The Load More button showed itself three times, first two times clicking it loaded and showed posts as expected, last time clicking it actually didn't find any posts still to be loaded, and instead inserted a previously-loaded post (that was recently loaded in / higher up the timeline / loaded when I clicked the button the first or second time) into where the Load More button had been. Nothing else changed until I scrolled up and down.

When scrolling up or down, the currently displayed posts were lost and were replaced with posts from the timeline location corresponding with the location of the post that replaced the Load More button, i.e. looks like the app had internally incorrectly jumped position in the timeline, but that this only was apparent when the posts currently in view were refreshed / re-checked.

I'll clear out all the cached data and log in again and see if things keep being inconsistent.

fin-w avatar Jun 14 '24 20:06 fin-w

Yes, this problem still exists. After clearing the app's local data, this time opening the timeline and pressing Load More loaded posts ok the first two times, but the second time it scrolled up the timeline. As in, the timeline clearly visibly changed and then scrolled up, not what I've mentioned before about the backend skipping further up the timeline.

fin-w avatar Jun 16 '24 00:06 fin-w

Yeah I just had a case where after reopening Tusky after a few hours, I clicked load More until there were between 4h and 9h ago still to load. When I clicked the button again, the button disappeared but a gap was left in the timeline where it used to be. Nothing else changed. I clicked a CW on a post already visible (i.e. previously loaded) and then Tusky instantly jumped location in the timeline to 44m ago i.e. part of what had been loaded just prior to coming across this issue.

fin-w avatar Jun 19 '24 07:06 fin-w

I'd really like to fix this but I fail to reproduce it :/

When I clicked the button again, the button disappeared but a gap was left in the timeline where it used to be.

Next time please take a screenshot

connyduck avatar Jun 19 '24 15:06 connyduck

This time, on the latest test version, I opened Tusky with ~9h gap back to the cached posts. Pressing Load More loaded posts ok the first few times, then pressing it would replace the Load More button with a post already recently loaded because the app had internally jumped places in the timeline. Scrolling up or down loaded posts from up the timeline and I checked down the timeline and no new posts appear to have been loaded. Pressing Load More again did load posts. This pattern happened a few times.

fin-w avatar Jun 21 '24 09:06 fin-w

I'd really like to fix this but I fail to reproduce it :/

When I clicked the button again, the button disappeared but a gap was left in the timeline where it used to be.

Next time please take a screenshot

When I say a gap I mean the button disappears. I think there's supposed to be a loading circle while posts are fetched but it doesn't appear. When I mention a gap, that's what I mean, it's just a blank bit in the timeline but no other UI element has changed.

fin-w avatar Jun 21 '24 09:06 fin-w

I managed to get a screenshot of it. This is immediately after clicking Load More. Sometimes the gap stays for a few seconds, sometimes less (might depend on the conection speed if it's connecting to a server I guess).

Screenshot_20240621-104102_Tusky Test_1

fin-w avatar Jun 21 '24 09:06 fin-w

Not sure if it's the same issue, but when I switch accounts and press the "load more" button, most of the time it loads the posts down instead of up. Here's a video:

https://github.com/user-attachments/assets/32c89b93-1c46-4350-bad8-aa397c1ee5c9

Jasdemi avatar Aug 04 '24 17:08 Jasdemi

Not sure if it's the same issue, but when I switch accounts and press the "load more" button, most of the time it loads the posts down instead of up.

Do you have reading position set to "oldest first"?

connyduck avatar Aug 18 '24 11:08 connyduck

Not sure if it's the same issue, but when I switch accounts and press the "load more" button, most of the time it loads the posts down instead of up.

Do you have reading position set to "oldest first"?

It's set to "oldest first". It only happens when switching to another account, as if it resets the reading order setting or something.

Jasdemi avatar Aug 18 '24 11:08 Jasdemi

It's set to "oldest first". It only happens when switching to another account, as if it resets the reading order setting or something.

You open Tusky, then it works fine on the first account? And then you switch to another account, where it does not?

connyduck avatar Aug 18 '24 14:08 connyduck

It's set to "oldest first". It only happens when switching to another account, as if it resets the reading order setting or something.

You open Tusky, then it works fine on the first account? And then you switch to another account, where it does not?

Exactly.

Jasdemi avatar Aug 18 '24 14:08 Jasdemi

Please test with the next nightly build (v26.0-9c87af4d) and report back @fin-w @Jasdemi There are several changes that should improve the situation.

connyduck avatar Aug 19 '24 18:08 connyduck

I don't think I'm seeing the problem any more, but it's hard to say for certain since I can't force it to appear. I've deleted all app data and reinstalled fresh with the most recent build and I don't think the problem appears any more! :)

fin-w avatar Aug 27 '24 12:08 fin-w

I haven't seen the bug after these fixes, I don't think, but I did just experience this now: the timeline looked fine, but then I favourited a post and it disappeared and was replaced with another post. Clicking to view the post confirmed that what I had faved was the new post, not the original that I thought I was faving. The actual post was a few posts down (a few mims older) in the timeline. I may have got to this point by briefly reading the timeline, scrolling up to refresh, then scrolling back down, but I'm not sure.

I'm logged in to two accounts and completely deleted app data and reinstalled the app recently.

fin-w avatar Sep 06 '24 15:09 fin-w

I think I saw the bug again. I wonder if it's triggered by scrolling while loading posts? I've only noticed it after pulling the timeline to refresh, not when clicking the load more button.

fin-w avatar Sep 10 '24 01:09 fin-w

@connyduck On the most recent build, I saw this issue in the notifications tab instead of a timeline. Left Tusky open but screen off for a while, unlocked phone, swipe refreshed notifs (maybe twice?), maybe swiped between timelines while the refresh was ongoing, then went back to notifs and because a new notif had loaded but was (incorrectly) not being displayed, the top entry opened a different post (the new notif) to what it was showed as in the notifs timeline. Went back to the notifs timeline from the post, and the second most recent notif was displayed twice. First occurrence went to the new notif / different post, second occurrence went to the expected post.

fin-w avatar Oct 13 '24 01:10 fin-w