fix(github): self-heal stale installation tokens on collaborator/user reads (#9315) - #9378
Conversation
JSONbored#9085 Update the Postgres retention mock for PK-ordered deletes and flip the confidence-less salvageability assertion to match CONFIDENCE_WHEN_UNSTATED. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-27 16:10:40 UTC
Review summary Nits — 3 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionNot yet addressed 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. Decision record
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9378 +/- ##
==========================================
+ Coverage 75.38% 75.49% +0.11%
==========================================
Files 275 276 +1
Lines 58023 58322 +299
Branches 6181 6293 +112
==========================================
+ Hits 43739 44032 +293
- Misses 14014 14015 +1
- Partials 270 275 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
LoopOver is closing this pull request on the maintainer's behalf (Linked issue does not appear to be satisfied). 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.