Skip to content

fix(profile) Handle resource-limited GitHub profile queries#78

Open
sfitzgerald-x1 wants to merge 3 commits into
Younesfdj:masterfrom
sfitzgerald-x1:scott/fix-resource-limit-profiles
Open

fix(profile) Handle resource-limited GitHub profile queries#78
sfitzgerald-x1 wants to merge 3 commits into
Younesfdj:masterfrom
sfitzgerald-x1:scott/fix-resource-limit-profiles

Conversation

@sfitzgerald-x1

@sfitzgerald-x1 sfitzgerald-x1 commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Fixes profiles that exist on GitHub but show as "No GitHub user by that name" when GitHub GraphQL rejects GitFut's full contribution query with RESOURCE_LIMITS_EXCEEDED.

Changes Introduced

  • Treat non-rate-limit GraphQL execution errors as real errors instead of collapsing data.user: null into notfound.
  • Preserve GitHub's real NOT_FOUND GraphQL response shape on the existing 404/notfound path.
  • Keep usable partial GraphQL profile data when GitHub returns field-level errors alongside data.user.
  • Add a resource-limit recovery path that fetches profile basics, then rebuilds detailed contribution data from short contribution windows when GitHub refuses the one-shot query.
  • Recover real recent commits, PRs, reviews, issues, restricted contributions, active-day calendar data, and contributed-repo language data for affected profiles.
  • Fetch lifetime contribution totals with typed contribution fields and recursively split if a yearly range is too expensive.
  • Add regression coverage for RESOURCE_LIMITS_EXCEEDED, generic GraphQL execution errors, real NOT_FOUND responses, and partial-data responses.

Risk Assessment

  • Normal successful profile scouts keep using the existing full query path.
  • The detailed fallback is used only for GitHub resource-limit failures and limits concurrent fallback requests to avoid a burst of GraphQL calls.
  • If a specific fallback window still fails from a transient network/resource issue after retry, that window degrades to zero rather than failing the whole scout, matching the existing best-effort lifetime behavior.
  • No dependency or schema changes.

Verification Evidence

  • npx vitest run tests/client.test.ts - 19 tests passed.
  • npm test - 21 files / 241 tests passed.
  • npx tsc --noEmit - passed.
  • npm run lint - passed with existing warnings only.
  • Local live check: GET /api/card/sfitzgerald-x1 now returns a detailed card with PRs, reviews, active days, contributed repo language data, and lifetime contributions instead of a false 404.
  • Local live check: GET /api/card/definitely-missing-gitfut-user-xyz still returns 404 with No GitHub user by that name.

Screenshot Comparison

Production https://gitfut.com/sfitzgerald-x1 Localhost after this fix
Production false not-found page Localhost fixed detailed GitFut card

@sfitzgerald-x1
sfitzgerald-x1 marked this pull request as draft July 16, 2026 21:33
@sfitzgerald-x1
sfitzgerald-x1 marked this pull request as ready for review July 16, 2026 22:19
@sfitzgerald-x1 sfitzgerald-x1 changed the title Handle resource-limited GitHub profile queries Bugfix: Handle resource-limited GitHub profile queries Jul 17, 2026
@sfitzgerald-x1 sfitzgerald-x1 changed the title Bugfix: Handle resource-limited GitHub profile queries fix(profile) Handle resource-limited GitHub profile queries Jul 17, 2026
@sfitzgerald-x1 sfitzgerald-x1 changed the title fix(profile) Handle resource-limited GitHub profile queries fix(card) Handle resource-limited GitHub profile queries Jul 17, 2026
@sfitzgerald-x1 sfitzgerald-x1 changed the title fix(card) Handle resource-limited GitHub profile queries fix(profile) Handle resource-limited GitHub profile queries Jul 17, 2026
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.

1 participant