From 433d5cf04f0477b1f530fb9a666c7fa7350da548 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 10 Jan 2026 14:52:42 +0000 Subject: [PATCH 1/2] Initial plan From cad6b5049298f910da90bfb98221d7f95abf47f9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 10 Jan 2026 14:55:33 +0000 Subject: [PATCH 2/2] Fix pagination limit warning condition - 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> --- src/hooks/useGitHubDataFetching.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hooks/useGitHubDataFetching.ts b/src/hooks/useGitHubDataFetching.ts index 6fd0af3..c06f10e 100644 --- a/src/hooks/useGitHubDataFetching.ts +++ b/src/hooks/useGitHubDataFetching.ts @@ -139,6 +139,7 @@ export const useGitHubDataFetching = ({ let page = 1; const perPage = GITHUB_API_PER_PAGE; const maxPages = 10; // GitHub Search API allows up to 1000 results (10 pages * 100 per page) + let totalCount = 0; const searchQuery = `(author:${username} OR assignee:${username}) AND updated:${startDate}..${endDate} AND (is:issue OR is:pr)`; @@ -162,7 +163,7 @@ export const useGitHubDataFetching = ({ } const searchData = await response.json(); - const totalCount = searchData.total_count; + totalCount = searchData.total_count; const items = searchData.items; // Add original property to search items and ensure assignee data is preserved @@ -191,11 +192,11 @@ export const useGitHubDataFetching = ({ } } - // Log if we hit the pagination limit - if (page > maxPages) { + // Log if we hit the pagination limit but there are more items available + if (allItems.length < totalCount) { console.warn( `Reached GitHub Search API pagination limit (${maxPages} pages) for ${username}. ` + - `Returning ${allItems.length} items. GitHub API limits search results to 1000 items.` + `Returning ${allItems.length} items out of ${totalCount} total. GitHub API limits search results to 1000 items.` ); }