Skip to content

Fix/GitHub disconnect - #122

Merged
DevOlabode merged 1 commit into
mainfrom
fix/github-disconnect
Sep 30, 2026
Merged

DevOlabode merged 1 commit into
mainfrom
fix/github-disconnect

Conversation

@DevOlabode

Copy link
Copy Markdown
Member

closes #121

@DevOlabode DevOlabode self-assigned this Aug 28, 2026
@DevOlabode
DevOlabode removed the request for review from ieliofficial August 28, 2026 06:18
@DevOlabode
DevOlabode force-pushed the fix/github-disconnect branch from a765983 to 9889411 Compare August 28, 2026 06:20

@ieliofficial ieliofficial left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend shape is right and both revoked paths on /storages are tested.

It only covers /storages though. /storage/name-availability (auth.js:117)
and /storage/create (auth.js:147) still answer a revoked token with a 400
and no GITHUB_AUTH_REVOKED code, so the frontend falls back to matching
the error string. Can those two use githubAccessRevoked() as well? That's
also what #121 asks for.

One other thing, not in the body: Cancel on Connect now signs you out
(App.jsx:376). Right for the revoked case, but is it right for someone
who just clicked Connect by mistake?

Those two and I'll merge.

@ieliofficial

Copy link
Copy Markdown
Member

Close, but getOctokit has a bug in the one path this PR exists for. It calls githubAccessRevoked(res), but getOctokit only takes clients and makeAuthRouter has no res in scope, so that branch throws a ReferenceError. The catch checks err.status === 401 and a ReferenceError has none, so a missing client comes back as a 500 "Failed to list storages" instead of the 401. Tests pass because the revoked test supplies githubClient: { mock: true }, so a client exists and that branch never runs. Pass res in, and have the caller return early rather than assigning the guard result to octokit, otherwise the handler carries on and tries to send a second response. Also /storage/create still has its own inline check returning a 400 with no code, which is exactly the string matching #121 is meant to remove. One sequencing note: #104 is approved and deletes /storage/name-availability, so once it lands, rebase on main and you will drop the work on that endpoint and the ConnectView conflict in one go. No rush on this until then.

@DevOlabode
DevOlabode force-pushed the fix/github-disconnect branch from f4bfcb4 to 6d9d0c1 Compare September 19, 2026 00:08
@DevOlabode
DevOlabode requested review from ieliofficial and removed request for ieliofficial September 23, 2026 23:02

@ieliofficial ieliofficial left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three points are fixed, and the no-client tests are exactly what was missing. Once #104 is in, rebase onto main. It deletes /storage/name-availability, so drop your guard and test for that route when you resolve the ConnectView conflicts. Small thing you can fold into the same push: cancelling on a revoked connection clears the page and sends you to sign in but never calls logout, so the old session is still there after a refresh.

- Return 401 GITHUB_AUTH_REVOKED from /storages, /storage/discover and
  /storage/create when the GitHub client is missing or GitHub rejects the token
- Keep the 401 status when discovery fails to look up the GitHub user
- ConnectView offers Reconnect GitHub instead of creating storage on revoke
- Cancelling on a revoked connection now logs out before redirecting to sign-in
@DevOlabode
DevOlabode force-pushed the fix/github-disconnect branch from 0a800dc to 978d93f Compare September 30, 2026 17:48
@DevOlabode
DevOlabode merged commit 96ce125 into main Sep 30, 2026
2 checks passed
@DevOlabode
DevOlabode deleted the fix/github-disconnect branch September 30, 2026 18:51
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.

Fix GitHub App Reinstallation Flow After App Revocation

2 participants