fix: pr-bug-scan validated finding from #4437#4735
Open
buf0-bot[bot] wants to merge 1 commit into
Open
Conversation
Cap GraphQL `first` at 50 per request and walk cursors to accumulate up to effectiveLimit, blocking Linear's 50-arg connection cap on Load more.
Contributor
There was a problem hiding this comment.
Reviewed changes — fixes a bug where listIssues passed first values > 50 to Linear's GraphQL API (cap at 50), causing requests to fail when users clicked "Load more" past the initial 36-item page. Replaces single-request fetching with a cursor-walking loop that paginates at 50 per rawRequest call and accumulates up to effectiveLimit.
- Add
LINEAR_ISSUE_API_PAGE_SIZE_MAXandendCursortopageInfo— caps per-request page size at 50 and surfaces the cursor from Linear's connection response. - Add
$after/endCursorto all 4 GraphQL queries —ALL_ISSUES_QUERY,VIEWER_ASSIGNED_ISSUES_QUERY, andVIEWER_CREATED_ISSUES_QUERYnow accept and return pagination cursors. - Refactor
listIssueswithfetchPagehelper and cursor-walking loop — eachrawRequestsendsmin(50, remaining), walksendCursoruntileffectiveLimitis reached or the server reports no more pages, with guards against stuck cursors and empty pages.
✅ No new issues found.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
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.

Automated fix-PR from pr-bug-scan for parent #4437.
Fixer status:
FIXED_WITH_CODE_PROOFSummary: Cap GraphQL
firstat 50 per request and walk cursors to accumulate up to effectiveLimit, blocking Linear's 50-arg connection cap on Load more.Blocked proof link:
src/main/linear/issues.ts:338 variables = { first: effectiveLimit, orderBy } passed directly to ALL_ISSUES_QUERY/VIEWER_*_ISSUES_QUERY rawRequest with first=72/108/.../216Typecheck:
passProof (from validator)
code_analysisReproduction
pnpm vitest run --config config/vitest.config.ts src/main/linear/issues.test.tsGenerated by
pr-bug-scan(proof-machine architecture). Human approval required before merge.