Show the whole poll archive, not the first 50 - #108
Merged
Conversation
/v1/polls answers 50 at a time unless asked otherwise, and getPolls sent no limit, so the archive page rendered 50 of the 179 polls it should have. The missing ones were unreachable by any means -- there is no "load more" for scrolling to reveal. Page through with limit and offset until a short page comes back, rather than asking for one large number: the endpoint caps a request at 200, so a single big limit would only move the cliff rather than remove it. A failure part-way through keeps the pages already read instead of returning empty, so a mid-walk blip degrades the archive rather than blanking it. Only the first page still falls back to empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q11ahEMb1HbNDmkd7gwRpr
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.
/v1/pollsanswers 50 at a time unless asked otherwise, andgetPollssent nolimit, so the archive page rendered 50 of the 179 polls it should have. The missing ones were unreachable by any means — there is no "load more", so scrolling would not have revealed them either.Page through with
limitandoffsetuntil a short page comes back, rather than asking for one large number: the endpoint caps a request at 200, so a single big limit would only move the cliff rather than remove it.A failure part-way through keeps the pages already read instead of returning empty, so a mid-walk blip degrades the archive rather than blanking it. Only the first page still falls back to empty.
Testing
astro check— 0 errors. Verified against the live CMS that the paging walks all 179 polls and stops on the short page.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q11ahEMb1HbNDmkd7gwRpr