Skip to content

Fix pagination loop termination with Since filter - #14

Open
singularitycurse26-svg wants to merge 1 commit into
alisteuber4ee1:mainfrom
singularitycurse26-svg:fix/pagination-termination
Open

Fix pagination loop termination with Since filter#14
singularitycurse26-svg wants to merge 1 commit into
alisteuber4ee1:mainfrom
singularitycurse26-svg:fix/pagination-termination

Conversation

@singularitycurse26-svg

Copy link
Copy Markdown

Fixes #1

Problem

The pagination loop when fetching issues with the Since filter can fail in several edge cases:

  1. No nil check on resp before accessing resp.NextPage (can panic)
  2. Duplicate issues can be fetched across pages
  3. No context cancellation check between pages

Fix

In pkg/github/client.go:

  • Added nil response check: if resp == nil || resp.NextPage == 0
  • Added deduplication using a seen map keyed by issue ID
  • Added context cancellation check between pages
  • The Since parameter is already preserved across pages since opt.Since is set once and never modified

In pkg/github/client_test.go:

  • Added TestFetchIssues_DuplicatePrevention test that verifies duplicate issues across pages are filtered out

/claim #1

@opirebot

opirebot Bot commented Jul 20, 2026

Copy link
Copy Markdown

👀 We've notified the reward creators here.
Make sure your payment account is ready to receive the payment for your hard work 💪

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.

🎯 Fix Pagination Loop Termination When Fetching Repository Issues with 'Since' Filter

1 participant