Skip to content

chore(deps): update electron to v42 and migrate to async safeStorage#2839

Merged
afonsojramos merged 4 commits intomainfrom
check-electron-42-prs
May 6, 2026
Merged

chore(deps): update electron to v42 and migrate to async safeStorage#2839
afonsojramos merged 4 commits intomainfrom
check-electron-42-prs

Conversation

@afonsojramos
Copy link
Copy Markdown
Member

Summary

  • Bumps electron from 41.5.0 to 42.0.0.
  • Migrates src/main/handlers/storage.ts to the new async safeStorage.encryptStringAsync / decryptStringAsync introduced in electron/electron#49054, which uses os_crypt_async to discover Linux secret service providers via D-Bus instead of relying on XDG_CURRENT_DESKTOP.
  • Fixes "Encryption is not available" on Linux tiling WMs (Hyprland, Sway, i3, etc.) — supersedes the D-Bus workaround proposed in fix: Improve password store detection on Linux tiling WMs #2785, which can now be closed.

Test plan

  • `pnpm install` clean on Electron 42.0.0
  • `pnpm test` — 933 tests / 133 files passing
  • `pnpm lint:check` clean on changed files
  • Manual verification of login flow on Linux Hyprland / macOS / Windows

@github-actions github-actions Bot added the dependency Dependency updates label May 6, 2026
@afonsojramos
Copy link
Copy Markdown
Member Author

@BlueManCZ can you test this branch to validate that it indeed works?

@setchy
Copy link
Copy Markdown
Member

setchy commented May 6, 2026

Awesome!!! From memory there may be a website FAQ re Linux flags we can cleanup now, too!

@BlueManCZ
Copy link
Copy Markdown
Contributor

@afonsojramos Pulled this down locally and the dev build fails to authenticate — Octokit throws Token passed to createTokenAuth is not a string.

The cause is in src/main/handlers/storage.ts: safeStorage.decryptStringAsync doesn't return a string like the sync decryptString did — it returns { shouldReEncrypt: boolean, result: string } (Electron docs). The current handler returns the whole object, so the renderer ends up storing/passing that object as the token.

Minimum fix is to unwrap .result before returning. Worth also handling shouldReEncrypt — when it's true, re-encrypt the token and persist it so we transparently roll forward when the OS keychain rotates keys.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@setchy
Copy link
Copy Markdown
Member

setchy commented May 6, 2026

Awesome!!! From memory there may be a website FAQ re Linux flags we can cleanup now, too!

This one: https://gitify.io/faq/#encryption-not-available-linux

@afonsojramos
Copy link
Copy Markdown
Member Author

@BlueManCZ great catch, thanks for pulling it down and digging in.

You were right, fixed in e1049f5. It now unwraps .result now. also tightened the mock typing in storage.test.ts (satisfies Pick<SafeStorage, ...>) so this exact drift fails at tsc time next round.

On the re-encrypt-and-persist piece - leaving it as a follow-up since it touches the renderer’s auth store.

@BlueManCZ
Copy link
Copy Markdown
Contributor

Thank you for the changes. I can confirm that it works now without any issues on Hyprland. No need for the --password-store flag anymore.

@afonsojramos afonsojramos merged commit 683655f into main May 6, 2026
17 checks passed
@afonsojramos afonsojramos deleted the check-electron-42-prs branch May 6, 2026 22:06
@github-actions github-actions Bot added this to the Release 7.0.0 milestone May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency Dependency updates

Development

Successfully merging this pull request may close these issues.

3 participants