Skip to content

fix(pm-desktop): list GitHub App repos via installations - #7

Merged
danii1 merged 1 commit into
mainfrom
fix/pm-desktop-github-repo-list
Aug 15, 2026
Merged

fix(pm-desktop): list GitHub App repos via installations#7
danii1 merged 1 commit into
mainfrom
fix/pm-desktop-github-repo-list

Conversation

@danii1

@danii1 danii1 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Connect GitHub in pm-desktop listed repos with GET /user/repos. For GitHub App user tokens (ghu_) that endpoint often returns an empty array for org installs even when DevIntern PM is installed, and the UI treated that as “install the app.”

  • List OAuth repos via GET /user/installations + GET /user/installations/{id}/repositories (PAT still uses /user/repos)
  • Treat a missing token as auth_required instead of a successful empty list
  • Report OAuth as disconnected when refresh fails so the dialog asks to sign in again

Test plan

  • bun run --filter @devintern/pm-desktop test
  • Packaged or bun run dev build with GITHUB_OAUTH_CLIENT_ID set
  • Sign in with GitHub against an org where the app is already installed — org repos appear
  • Sign in with no installations — “Install app on GitHub” still shows
  • PAT path still lists /user/repos
  • Expired OAuth session with a failed refresh asks to sign in instead of showing an empty list

OAuth Connect used GET /user/repos, which often returns [] for org
installs even when the app is installed. Walk /user/installations and
each installation's repositories instead.

A missing or unrefreshable token now surfaces as auth_required, and
OAuth status is disconnected when refresh fails, so the UI asks to
sign in instead of showing a false empty list / install prompt.
@danii1
danii1 merged commit f6b8e83 into main Aug 15, 2026
1 check passed
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