Skip to content

chore(deps): upgrade Electron to 42.2.0#117

Merged
ThomasHalwax merged 2 commits into
mainfrom
chore/electron-42
May 21, 2026
Merged

chore(deps): upgrade Electron to 42.2.0#117
ThomasHalwax merged 2 commits into
mainfrom
chore/electron-42

Conversation

@ThomasHalwax
Copy link
Copy Markdown
Member

@ThomasHalwax ThomasHalwax commented May 21, 2026

Summary

Upgrades Electron from 38.8.6 to 42.2.0, resolving the last remaining high-severity npm audit finding (electron <=39.8.4, 17 advisories).

Changes

  • electron 38.8.6 → 42.2.0 (package.json ^42.2.0)
  • Harden the app:// protocol handler so it always resolves to a Response (404 on a missing file) instead of returning a rejected net.fetch() promise, which surfaced as a net::ERR_FILE_NOT_FOUND error
  • Document build hygiene in the README

Breaking change review (v39–42)

Reviewed Electron's breaking-changes.md for v39–42 against our main-process API usage (app, BrowserWindow, ipcMain/ipcRenderer, webContents, session.webRequest, protocol.handle, Menu, dialog, shell, screen, net). No code changes required — none of the removed or deprecated APIs are used.

Notes:

  • leveldown 6.x ships N-API prebuilds (ABI-stable) — no native module rebuild needed for the new Node ABI.
  • macOS notifications now use UNNotification (v42) and require a code-signed app to display; release builds are signed, unsigned dev builds emit a failed event instead.
  • nativeWindowOpen webPreference has been a no-op since v22 (left as-is).

Validation

  • App launched on Electron 42.2.0: renderer runs un-sandboxed as required by nodeIntegration, leveldown loads, preload initializes correctly.
  • npm run lint: clean · test suite: 332 passing.

Note on the DevTools freeze

While testing, opening Chrome DevTools froze the renderer. Investigation (stack sampling the frozen renderer — main thread blocked in mach_msg) traced this to a mismatched bundle/source map in a partially built dist/, not an app-code or Electron 42 defect: a clean rebuild does not freeze, and npm run hot never did. There is no freeze-related code fix here — the README now documents the build-hygiene workaround.

Major bump from 38.8.6 to 42.2.0, resolving the remaining high-severity
audit finding (electron <=39.8.4, 17 advisories).

Reviewed Electron breaking changes for v39-42 against our main-process
API usage (app, BrowserWindow, ipcMain/Renderer, webContents,
session.webRequest, protocol.handle, Menu, dialog, shell, screen, net):
no code changes required. None of the removed/deprecated APIs are used.

Notes:
- leveldown 6.x ships N-API prebuilds (ABI-stable), so no native
  module rebuild is needed for the new Node ABI.
- macOS notifications now use UNNotification (v42): they require a
  code-signed app to display. Release builds are signed; unsigned dev
  builds will emit a 'failed' event instead.
- nativeWindowOpen webPreference (WindowManager.js) has been a no-op
  since v22; left as-is, not introduced here.

Validated by launching the app on Electron 42: renderer runs
un-sandboxed as required by nodeIntegration, leveldown loads, preload
initializes correctly.
The app:// protocol handler returned net.fetch() directly, so a request
for a missing file produced a rejected handler promise instead of a
proper response, surfacing as a net::ERR_FILE_NOT_FOUND error. The
handler now always resolves to a Response (404 on a missing file).

Also documents build hygiene in the README: a partial webpack build can
leave dist/ with a mismatched bundle and source map, which freezes the
renderer when DevTools is opened. A clean rebuild resolves it.
@ThomasHalwax ThomasHalwax merged commit e81a8cf into main May 21, 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