Skip to content

build(deps-dev): bump electron to 45.0.0 - #2042

Open
BlackHole1 wants to merge 3 commits into
mainfrom
build/bump-electron-45
Open

BlackHole1 wants to merge 3 commits into
mainfrom
build/bump-electron-45

Conversation

@BlackHole1

@BlackHole1 BlackHole1 commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

The Windows test job has been failing on every PR and on main because "watches for the types file to be updated" in tests/main/electron-types.spec.ts always times out. Tests run under Electron 42, which bundles Node.js 24.19.0, and that libuv build reports mangled filenames from fs.watch() when the watched directory path contains 8.3 short names (libuv/libuv#5010, nodejs/node#63638). GitHub Actions sets TEMP to C:\Users\RUNNER~1\AppData\Local\Temp, so node-watch receives something like -abc123\electron.d.ts instead of electron.d.ts, never matches the types file, and never emits the change event. Plain Node.js 24.19.0 hits the same bug as an assertion crash, and the fix landed in Node.js 24.21.0. Electron 42 is still on 24.19.0 in its latest patch, while Electron 45 bundles 24.22.0, so this bumps electron to ^45.0.0.

Electron 44 stopped publishing Windows ia32 and Linux armv7l binaries, so the release workflow no longer builds Fiddle for those two targets. The test and build matrix entries labeled armv7l already ran on arm64 hosts and are relabeled arm64, which renames those check runs.

Electron 45 also deprecates the synchronous safeStorage methods, so GitHub token storage in src/main/github.ts now uses encryptStringAsync(), decryptStringAsync() and isAsyncEncryptionAvailable(). Tokens written by the old sync API still decrypt with the async one, and the stored token is re-encrypted on a best-effort basis when shouldReEncrypt is reported. Because decryption is now async, a sign-in or sign-out that lands while the startup auth check is decrypting would have been overwritten, so both bump authGeneration_ and a stale check leaves the newer auth state alone. Both cases have new tests.

Verified with yarn lint, yarn format, yarn tsc and the full yarn test:ci on macOS and on Windows with a CI-style short TEMP. The electron-types test now passes on Windows.

The first CI run on this PR also hit an existing flake in tests/main/devtools.spec.ts that fails on Electron 42 too. Its async vi.hoisted() factory was never awaited, so the dynamic import inside it raced with the module imports and the devmode automock was sometimes not applied under a full parallel run. Awaiting the factory fixes it, and six consecutive full runs on Windows now pass where two of five failed before.

Electron 42 bundles Node.js 24.19.0, whose libuv reports mangled filenames from `fs.watch()` when the watched directory contains 8.3 short names (libuv/libuv#5010). GitHub Actions sets TEMP to such a path (C:\Users\RUNNER~1\...), so the "watches for the types file to be updated" test in _tests/main/electron-types.spec.ts_ never saw its change event and failed on every Windows run. Electron 45 bundles Node.js 24.22.0, which carries the fix.

Electron 44 dropped Windows ia32 and Linux armv7l binaries, so the release workflow no longer builds those targets, and the test and build matrix entries that already ran on arm64 hosts are relabeled arm64.

The synchronous `safeStorage` methods are deprecated in Electron 45, so token storage in _src/main/github.ts_ moves to `encryptStringAsync()`, `decryptStringAsync()` and `isAsyncEncryptionAvailable()`. Tokens saved by earlier versions still decrypt, and a token is re-encrypted when `shouldReEncrypt` is reported.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@BlackHole1
BlackHole1 requested review from a team and codebytere as code owners October 24, 2026 06:43
@socket-security

socket-security Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedelectron@​42.11.3 ⏵ 45.0.0100100 +19100 +198100

View full report

@socket-security

socket-security Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • electron@45.0.0

View full report

@coveralls

coveralls commented Oct 24, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 87.379% (+0.04%) from 87.341% — build/bump-electron-45 into main

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread src/main/github.ts
Comment thread src/main/github.ts Outdated
@BlackHole1

Copy link
Copy Markdown
Member Author

@SocketSecurity ignore npm/electron@45.0.0

The `vi.hoisted()` factory is async but was never awaited, so its `import('../utils.js')` raced with the test module's own imports. Under the load of a full parallel run the devmode automock was sometimes not registered in time, `isDevMode` resolved to the real function, and all three tests failed with `mockReturnValue is not a function`. This flaked on Windows and Linux arm64 CI. Awaiting the factory at the top level makes the hoisted import finish before the module imports are evaluated.

Signed-off-by: Kevin Cui <bh@bugs.cc>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Still open from earlier reviews (2):

  • Unresolved: 2 minor or pre-existing.

Moving to the async `safeStorage` API added an await between reading the stored token and assigning `octokit_`. A sign-out during the startup auth check (for example while a keychain prompt is open) was then undone when decryption resolved, and with `shouldReEncrypt` the deleted credentials file was written back. Sign-in and sign-out now bump `authGeneration_`, and a check that sees it change reports a result the renderer ignores and skips the re-encrypt write.

Re-encrypting after a key rotation is now best-effort, so a failed write no longer turns a valid token into a signed-out state.

Signed-off-by: Kevin Cui <bh@bugs.cc>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

This branch has not been deployed

No deployments
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.

2 participants