Skip to content

fix: empty result pages terminate the infinite scroll walk - #18

Merged
ghostcoder42 merged 1 commit into
mainfrom
fix/endless-pagination-walk
Oct 9, 2026
Merged

ghostcoder42 merged 1 commit into
mainfrom
fix/endless-pagination-walk

Conversation

@ghostcoder42

Copy link
Copy Markdown
Owner

The site's pagination lies on past-the-end pages: an empty result page still renders pagination.next markers (verified live — page 2 of a 1-result search returns 0 cards with 3 next markers). Trusting the marker kept hasNextPage true after the walk hit the void, so every scroll bounce at the bottom fired another guaranteed-empty fetch, even with the "已经看完啦" footer already on screen.

An empty page is now always terminal: parseVideoList returns nextPage/lastPage null when it yields no cards, regardless of what the pagination markers claim. Requests were already sequential (the isFetchingNextPage guard); this ends the chain itself.

The site's pagination lies on past-the-end pages: an empty result page
still renders pagination.next markers (verified live — page 2 of a
1-result search returns 0 cards with 3 next markers). Trusting the
marker kept hasNextPage true after the walk hit the void, so every
scroll bounce at the bottom fired another guaranteed-empty fetch, even
with the "已经看完啦" footer already on screen.

An empty page is now always terminal: parseVideoList returns
nextPage/lastPage null when it yields no cards, regardless of what
the pagination markers claim. Requests were already sequential (the
isFetchingNextPage guard); this ends the chain itself.
@ghostcoder42
ghostcoder42 merged commit 537ec11 into main Oct 9, 2026
1 check passed
@ghostcoder42
ghostcoder42 deleted the fix/endless-pagination-walk branch October 9, 2026 07: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