fix(github): self-heal stale installation tokens on collaborator/user reads (#9315) - #9371
Conversation
… reads (JSONbored#9315) getRepositoryCollaboratorPermission and getGithubUserCreatedAt called createInstallationToken directly with no retry, so a transient bad-credentials 401 failed closed (or silently disabled the account-age check). Route both through withInstallationTokenRetry like every sibling GitHub helper (JSONbored#6191/JSONbored#8892). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
❌ 3 Tests Failed:
View the top 2 failed test(s) by shortest run time
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-27 14:54:56 UTC
Review summary Nits — 3 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
getRepositoryCollaboratorPermissionandgetGithubUserCreatedAtinwithInstallationTokenRetry(same convention as#6191/#8892).nulland non-token failures still throw (collaborator) or fail-open tonull(user created_at).Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpx vitest run test/unit/github-app.test.ts -t "9315|collaborator permission|getGithubUserCreatedAt"— 8 passedtest/unit/github-app.test.ts— 103+ passed (incl. new cases)npm run test:ci(full gate; run before push)If any required check was skipped, explain why:
Implementation + targeted regression tests complete. Full
test:cileft for the opener.Safety
site/,CNAME,**/lovable/**, or rootCHANGELOG.md.UI Evidence
N/A — GitHub App token-retry plumbing only; no visible UI change.
Notes for reviewers / gate
statuson the thrown Error soisGitHubBadCredentialsErrorrecognizes empty-body 401s.getGithubUserCreatedAtthrows on 401/403 inside the retry wrapper (so a stale token can self-heal) and still fail-opens via the outercatchfor anything that is not healed.