Fix lazy load pagination stalls and null API response crashes - #150
Open
courville wants to merge 2 commits into
Open
Fix lazy load pagination stalls and null API response crashes#150courville wants to merge 2 commits into
courville wants to merge 2 commits into
Conversation
courville
commented
Aug 25, 2026
Contributor
- Fix lazy load pagination stalls in adaptive-mode and Fresh feeds when mark-as-read-on-scroll is enabled — shrinking unread counts were being mistaken for exhausted feeds.
- Guard against crashes when the API returns a null response in feed/subscribe screens.
getSkip() used numAll (total articles fetched this session) as the skip offset for adaptive mode once any unread articles existed, and unconditionally for all other view modes. With mark-as-read-on-scroll active, feeds whose membership is unread-only (adaptive mode while unread remain, the "unread" view mode, and the Fresh virtual feed) shrink as articles are marked read, so numAll overshoots the feed's actual remaining count. The server then returns 0 articles and lazy load is permanently disabled. Use numUnread as the skip offset for all of these unread-only cases, falling back to numAll once no unread articles remain (adaptive) or for view modes with stable membership (marked/published/search). Also stop disabling lazy load on firstIdChanged during append: mark- as-read-on-scroll changes the feed's first_id on the server, so firstIdChanged is set on every append response once scrolling starts, which permanently disabled lazy load after the first pagination request. Only treat it as a real feed-structure change on fresh (non-append) loads.
performRequest() can return null on HTTP error responses or after a caught exception, but several callers parsed the result unconditionally, risking a NullPointerException when a request fails at the transport/API level instead of via an explicit ApiError. Skip parsing when result is null in SubscribeActivity, FeedsModel, and RootCategoriesModel; the corresponding error is already surfaced via the existing m_lastError/toast handling.
Contributor
Author
|
Please do not merge yet: I still noticed a lazy loading issue that deserves attention. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.