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

Implement paging state restoration on process recreation and show user explicit retry buttons on paging errors #38

Merged
merged 25 commits into from
Jan 5, 2025

Conversation

HeroBrine1st
Copy link
Owner

This PR resolves page refreshing if application is required to free some memory to system. Tested on whole process death, but this bug was seen partially, with some components in navigation stack having cached data and some not having.

Other changes:

  • Implemented page dropping feature to save memory on very long scrolls
  • Reduced page size from 500 to 100 due to upstream bug with LazyList index restoration via keyed items
  • Refactored Pager and moved away from AndroidX Paging architecture, leading to unencouragement of Pager multi-usage.
  • Removed automatic retry to not bomb API server with requests
  • Added retry buttons where applicable

This PR is being tested.

@HeroBrine1st HeroBrine1st force-pushed the feature/paging-restoration branch from 88f1fdf to 386afcd Compare January 2, 2025 14:51
@HeroBrine1st
Copy link
Owner Author

HeroBrine1st commented Jan 5, 2025

There are bugs that are apparently fixed by 92c7ddf:

  • Going into post screen from posts screen and back (no info on timing) refreshes page. It is not complete cache loss as probably no request is made to the server (order:random returned the same posts in the same order, which is unlikely to happen)
  • Scroll snapping in the same situation as above (without refresh) but probably page dropping is involved

Attempts to get those bugs reproduced after that commit are futile, despite fixing nothing as state restoration feature is not used in this case

And, of course, prepend scroll position reset, which is seen for one frame (and immediately restored after). I don't see any same-frame solutions without architectural changes, so I left it as is.

Otherwise, this PR is complete and advanced features like agressive post caching are now possible

@HeroBrine1st HeroBrine1st marked this pull request as ready for review January 5, 2025 16:11
@HeroBrine1st HeroBrine1st changed the title Implement paging state restoration on process recreation Implement paging state restoration on process recreation and show user explicit retry buttons on paging errors Jan 5, 2025
@HeroBrine1st HeroBrine1st merged commit 33ea451 into master Jan 5, 2025
1 check passed
@HeroBrine1st HeroBrine1st deleted the feature/paging-restoration branch January 5, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant