Fix pagination limit warning condition in fetchAllSearchItems - #22
Merged
Merged
Conversation
- Changed condition from `page > maxPages` (which would never be true) to `allItems.length < totalCount` - Moved totalCount variable outside the loop to be accessible after loop completion - Now properly detects when pagination limit is hit with more items remaining - Updated warning message to show actual vs total count Co-authored-by: kertal <463851+kertal@users.noreply.github.com>
Deploying git-vegas with
|
| Latest commit: |
cad6b50
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5ba119ad.git-vegas.pages.dev |
| Branch Preview URL: | https://copilot-sub-pr-21.git-vegas.pages.dev |
Copilot
AI
changed the title
[WIP] Add pagination support for fetching GitHub issues
Fix pagination limit warning condition in fetchAllSearchItems
Jan 10, 2026
kertal
marked this pull request as ready for review
January 10, 2026 20:15
kertal
approved these changes
Jan 10, 2026
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.
The pagination warning condition
if (page > maxPages)never evaluates to true because the while loop exits whenpage <= maxPages, making post-looppageat mostmaxPages + 1. This meant the warning never fired when hitting GitHub's 1000-item search limit.Changes:
totalCountfrom loop-scoped to function-scoped variable to track total available itemsif (page > maxPages)toif (allItems.length < totalCount)to detect incomplete pagination${allItems.length} items out of ${totalCount} totalfor better visibility✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.