Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

fix: detect pagination truncation in installation repository lists

closed
#184 opened by detail-app[bot]detail/bug-fix/fix-detect-pagination-truncation-in-installation-r-a6df8e→main
Conversation4
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

Closes #171

Bug

listRepositories and userInstallationRepositories in packages/forge-github/src/client/installations.ts cap pagination at MAX_PAGES = 50 × PAGE_SIZE = 100 = 5000 repos. When a GitHub App installation has more than 5000 accessible repositories, the loop exhausts the page cap and silently returns a truncated list — no error, no log, no marker.

This truncated list is the sole GitHub-side input to adminOfEvery in apps/worker/src/jobs/recover-installation.ts, which decides the granted-admin authorization result. A user who is admin of only the first 5000 repos (but not the omitted ones) can be wrongly verified as admin of every repo and granted granted-admin, letting them claim/administer an org installation they don't fully control. Symmetrically, a legitimate full admin whose user-list is truncated can be wrongly denied.

Fix

After each pagination loop, compare the fetched count against the last-seen body.total_count and throw if found.length < totalCount. The throw propagates through verify() → outcomeFor()'s existing try/catch, which returns "failed" with "recovery-failed" — fail-closed, never silently authorizing on partial data. Applied to both listRepositories and userInstallationRepositories.

Testing

  • New unit tests in installations-pagination.test.ts verify both functions throw when total_count exceeds the cap (6000), throw at one-over-the-cap (5001), and do not throw at the exact cap (5000) or below.
  • New integration test in recover-installation.integration.test.ts verifies that a truncated listRepositories call causes recoverInstallation to return "failed", report "recovery-failed", and deny the claim (userCanClaimInstallation returns false).
  • Existing tests in installations.test.ts (6) and recover-installation.integration.test.ts (11) confirm no regression in normal pagination, early-return statuses, and the grant/deny paths.
  • Typecheck (tsrs, all 15 packages), Biome format/lint, boundary check, and anti-slop lint all pass.

Automatic Fixes PRs can be configured here.

unkey-deploy[bot]commented· 2 weeks ago

The latest updates on your projects. Learn more about Unkey Deploy

NameStatusPreviewInspectUpdated (UTC)
tripwire / web (preview)ReadyVisit PreviewInspectNov 7, 2026 6:55am
capy-ai[bot]commented· 2 weeks ago

Capy couldn't review this pull request because grim's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews.

Open in Capy

Changes requested

tripwire-sh[bot] · 2 weeks ago

Blocked. See the comment.

tripwire-sh[bot]commented· 2 weeks ago

@detail-app[bot], Tripwire blocked this change request.

Rate limit: You opened 58 change requests in a short time. Wait before you open another.

View on Tripwire

How do I fix this?

A new commit will not fix this.

If you think it should merge anyway, say so in a comment. A maintainer will decide.

Sign in to comment.

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.