Skip to content

fix(client): rely on Link header rel="next" and pageInfo.hasNextPage for pagination termination - #4

Open
M3ML1NE wants to merge 1 commit into
EncarnacionP:mainfrom
M3ML1NE:fix/auto-bounty-3
Open

M3ML1NE wants to merge 1 commit into
EncarnacionP:mainfrom
M3ML1NE:fix/auto-bounty-3

Conversation

@M3ML1NE

@M3ML1NE M3ML1NE commented Aug 11, 2026

Copy link
Copy Markdown

Summary of Changes

  • Refactored pagination handling (FetchAllPages and FetchAllPagesGraphQL) in pkg/client/pagination.go.
  • Replaced item length checks (len(items) < perPage) with RFC 5988 / GitHub REST Link header parsing (rel="next") and GraphQL pageInfo.HasNextPage.
  • Resolved premature termination on sparse pages (e.g. backend filtering, spam exclusion, or empty intermediate pages).
  • Added unit tests in pkg/client/pagination_test.go verifying pagination flow over sparse pages, empty pages with next link, and MaxItems capping.

/claim #3

…Info instead of page item count

- Ensure pagination continues when Link header rel="next" (REST) or hasNextPage (GraphQL) exists, even if items returned < perPage or 0 items.
- Added comprehensive unit tests covering sparse pages, empty intermediate pages, and max items capping.
@M3ML1NE

M3ML1NE commented Aug 11, 2026

Copy link
Copy Markdown
Author

/claim #3

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