Skip to content

refactor: move GitHub tokens to main#1942

Merged
dsanders11 merged 22 commits into
mainfrom
refactor/move-github-tokens-to-main
Jun 3, 2026
Merged

refactor: move GitHub tokens to main#1942
dsanders11 merged 22 commits into
mainfrom
refactor/move-github-tokens-to-main

Conversation

@ckerr
Copy link
Copy Markdown
Member

@ckerr ckerr commented May 8, 2026

Part six in a series to move GitHub token + gist management into the main process.

This PR:

  • Finishes updating the renderer code to make IPC calls to use the main process' renderer code.
  • Removes all references to Octokit from the renderer
  • Removes the token information from localStorage
  • Removes dead octokit-related code
  • Updates tests

@ckerr ckerr requested review from a team and codebytere as code owners May 8, 2026 20:09
@ckerr ckerr marked this pull request as draft May 8, 2026 20:10
@coveralls
Copy link
Copy Markdown

coveralls commented May 8, 2026

Coverage Status

coverage: 87.289% (-0.1%) from 87.403% — refactor/move-github-tokens-to-main into main

@ckerr ckerr force-pushed the refactor/move-github-tokens-to-main branch from a275545 to f4f6042 Compare May 9, 2026 04:06
@ckerr ckerr force-pushed the refactor/move-github-tokens-to-main branch from f4f6042 to 489fd5a Compare May 22, 2026 15:45
@ckerr ckerr force-pushed the refactor/move-github-tokens-to-main branch from 489fd5a to 813c174 Compare May 22, 2026 16:59
@ckerr ckerr marked this pull request as ready for review May 22, 2026 17:31
Copy link
Copy Markdown
Member

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

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

I think there's a regression here in regards to Internet access that we should resolve before merging.

From my reading of the code, if you successfully logged in, and then at a later time start Fiddle while offline, we'll keep the token on disk but the renderer will show the user as not being logged in with GitHub. Becoming online while Fiddle is still running would leave the app in a logged out state even though the user has a valid token.

I think the behavior we want is that when offline the user should still be shown as logged in as long as they have a token on disk. They should be able to click the log out button and clear the token. Logging in while offline will fail.

If we don't use the user's login name anywhere in the renderer, we may want to change ElectronFiddle.gitHubCheckAuth() to return { loggedIn: boolean } or something like that. In the offline case the main process would still return { loggedIn: true } if there's a token on disk, as that's all the renderer needs to know.

Comment thread src/renderer/components/commands-action-button.tsx
Comment thread src/renderer/app.tsx
ckerr and others added 2 commits May 28, 2026 10:02
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
@ckerr
Copy link
Copy Markdown
Member Author

ckerr commented May 28, 2026

From my reading of the code, if you successfully logged in, and then at a later time start Fiddle while offline, we'll keep the token on disk but the renderer will show the user as not being logged in with GitHub. Becoming online while Fiddle is still running would leave the app in a logged out state even though the user has a valid token.

Good call. 76dbba0

Comment thread src/main/github.ts Outdated
ckerr and others added 2 commits June 1, 2026 12:19
@dsanders11 dsanders11 merged commit 24cd830 into main Jun 3, 2026
17 checks passed
@dsanders11 dsanders11 deleted the refactor/move-github-tokens-to-main branch June 3, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants