fix(orb): degrade a thrown OAuth self-enrollment network error to the clean identity page - #8919
Conversation
… clean identity page handleOrbEnrollment's three GitHub network calls -- exchangeOrbOAuthCode, fetchOrbOAuthUser, and verifyInstallationAdmin -- handled every non-OK or malformed response cleanly but none was wrapped in try/catch. A thrown network error (DNS failure, or a timeout past timeoutFetch's own retry budget) escaped handleOrbOAuthCallback as an uncaught framework 500 instead of the module's own "Couldn't verify your GitHub identity" landing page. Wrap each of the three calls so a rejected fetch degrades to that clean 400 page, mirroring the failure-doesn't-escape convention already used in webhook.ts/relay.ts/ingest.ts. Cover each call's new catch path with an integration test that rejects the corresponding fetch. Closes JSONbored#8881
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8919 +/- ##
==========================================
- Coverage 93.84% 90.57% -3.28%
==========================================
Files 803 97 -706
Lines 80084 22539 -57545
Branches 24277 3904 -20373
==========================================
- Hits 75157 20415 -54742
+ Misses 3562 1945 -1617
+ Partials 1365 179 -1186
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 13:35:38 UTC
Review summary Nits — 4 non-blocking
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.
|
fix(orb): degrade a thrown OAuth self-enrollment network error to the clean identity page
handleOrbEnrollment's three GitHub network calls -- exchangeOrbOAuthCode,
fetchOrbOAuthUser, and verifyInstallationAdmin -- handled every non-OK or
malformed response cleanly but none was wrapped in try/catch. A thrown network
error (DNS failure, or a timeout past timeoutFetch's own retry budget) escaped
handleOrbOAuthCallback as an uncaught framework 500 instead of the module's own
"Couldn't verify your GitHub identity" landing page.
Wrap each of the three calls so a rejected fetch degrades to that clean 400
page, mirroring the failure-doesn't-escape convention already used in
webhook.ts/relay.ts/ingest.ts. Cover each call's new catch path with an
integration test that rejects the corresponding fetch.
Closes #8881
Validation
Verified locally on this branch before opening:
npm run typechecknpx turbo run build:tsc build:verifynpm run test:coverage— patch coverage 100.0% of changed lines