wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.96k stars 1.31k forks source link

[Reader] Reader suddenly stops fetching tag posts #19883

Open RenanLukas opened 9 months ago

RenanLukas commented 9 months ago

[!WARNING]
This issue was discovered after https://github.com/wordpress-mobile/WordPress-Android/pull/19881 fix, since we couldn't reach the state described here before that fix. If you follow the steps to reproduce without the commits in that PR, you won't be able to reproduce it.

https://github.com/wordpress-mobile/WordPress-Android/assets/14964993/e51092be-2ece-4ca0-a889-b5e334f4be42

Doesn't seem related to https://github.com/wordpress-mobile/WordPress-Android/pull/19881 since in that case we were still fetching the posts, and in this case fetching posts is not even triggered (I've debugged and fetch posts is not called). The progress UI is not even shown, which makes me think it might be UI related. Also, I've checked web and there were many more posts with the tag seen in the video that we were not fetching.

Expected behavior

We should continue to fetch tag posts when user scrolls down the list.

Actual behavior

At some point we stop fetching new tag posts when user scrolls down the list.

Steps to reproduce the behavior

Tested on [device], Android [version], JPAndroid / WPAndroid [version]
RenanLukas commented 9 months ago

Found the reason: https://github.com/wordpress-mobile/WordPress-Android/blob/ed5a5f5fd864615165326132f50282c27e020510/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java#L917

This limits the number of shown posts to 200, and we stop fetching after that. This logic is from 2015, so I couldn't find why we did it. Does it make sense trying to remove it?

cc @develric