Infinity-For-Reddit icon indicating copy to clipboard operation
Infinity-For-Reddit copied to clipboard

Scrolling position is reset when wifi connects/disconnects

Open RyanHx opened this issue 7 months ago • 1 comments

Checklist

  • [x] I have used the search function for open and closed issues to see if someone else has already submitted the same bug report.
  • [x] I will describe the problem with as much detail as possible.
  • [x] If the bug only occurs with a certain link, post, image..., I will include the URL.

App version

7.5.0

Where did you get the app from

Other

Android version

13

Device model

Moto G32

First occurred

Several weeks ago

Steps to reproduce

  1. Scroll down feed or comments
  2. Toggle wifi on/off
  3. Feed will snap back up to previous post/comment

Expected behaviour

Scrolling position does not change when connection changes.

Current behaviour

Scrolling position is changed without user input:

https://github.com/user-attachments/assets/785ee563-6e13-49ee-9b97-398618199f06

Image carousel positions are reset:

https://github.com/user-attachments/assets/fc70d641-6e45-4acd-bfeb-956f4a2914b3

Scrolling position in feed snaps back up to the closest top of a post:

https://github.com/user-attachments/assets/70fd7a8e-e1de-409b-be17-879666c7fc40

RyanHx avatar May 05 '25 12:05 RyanHx

I think I've tracked down where this is mainly happening. In the onChangeNetworkStatusEvent it checks whether you have data saving on OR if your video autoplay is set to only wifi. If either of those are true it'll call refreshAdapter() (link) which for some reason gets the closest previous post position and forcibly scrolls to it (link).

I've confirmed this by setting my video autoplay option to Never (data saving settings were already off) - this fixes all three issues detailed in the OP (scrolling in comments, feed, and carousel position).

The linked lines of code are just from PostFragment but the same behaviour seems to appear in CommentsListingFragment and a couple other files as well.

My hope is those can be changed to stop forcibly scrolling or resetting image carousels as it makes for a super frustrating experience to bounce around while scrolling in an area with spotty wifi.

RyanHx avatar May 10 '25 11:05 RyanHx