Skip to content

Update electron from 41.7.2 -> 43.4.1 due to electron 41 EOL - #2818

Merged
bengotow merged 1 commit into
Foundry376:masterfrom
wrench-exile-legacy:electron-43
Aug 23, 2026
Merged

Update electron from 41.7.2 -> 43.4.1 due to electron 41 EOL#2818
bengotow merged 1 commit into
Foundry376:masterfrom
wrench-exile-legacy:electron-43

Conversation

@wrench-exile-legacy

@wrench-exile-legacy wrench-exile-legacy commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Resolves #2660


Electron 41 becomes end of life on 25 Aug 2026.
https://endoflife.date/electron

This PR updates electron from 41.7.2 to 43.4.1.

I had to update node-abi to allow node-gyp to recognise the newer electron version, and update better-sqlite3 which has support for the newer javascript engine in newer versions of electron.

To reproduce the lock file, change electron to 43.4.1, and run the following:

  npm update better-sqlite3 node-abi
  cd app/
  npm update better-sqlite3 node-abi

- Updates node-abi to allow node-gyp to recognise the electron version.
- Updates better-sqlite3 to match the newer javascript engine in electron 43.
@bengotow

Copy link
Copy Markdown
Collaborator

@indent can you look at the changelogs for Electron 41 to Electron 43 (the version change in this PR) and go line by line and see if we are impacted by any deprecations, removals or other call-outs in the release notes? Is there anything that we need to update or consider hand-verifying alongside this version change?

@indent

indent Bot commented Aug 23, 2026

Copy link
Copy Markdown
PR Summary

Upgrades Electron from 41.7.2 to 43.4.1 ahead of Electron 41's EOL (25 Aug 2026), bumping better-sqlite3 (12.9.0→12.11.1) and node-abi (3.91.0→3.94.0) so node-gyp recognizes the newer Electron/ABI and better-sqlite3 supports the newer V8. It's a dependency-only change with no application source edits; scripts/postinstall.js already rebuilds native modules when the electron target changes.

  • Bumps electron to 43.4.1 in both root and app/ package.json + lockfiles.
  • Updates better-sqlite3 and node-abi to match the new Electron ABI.

Reviewed the Electron 41→43 changelog against Mailspring's usage; no code bug is introduced. Hand-verify items for the author: open-file dialogs without defaultPath now default to Downloads (v43); macOS notifications require code-signing so unsigned dev builds won't show them (v42); npm install no longer fetches the electron binary, so confirm CI/packaging (v42); and frameless windows get rounded corners on Linux (v43, cosmetic). One item to schedule separately (not broken by this PR): composer-editor.tsx reads the electron clipboard module in the renderer, which is removed in Electron 44 and should be migrated before that upgrade.

Issues

Review closed.

@indent

indent Bot commented Aug 23, 2026

Copy link
Copy Markdown

On it. I'll pull the Electron 42 and 43 breaking-change/deprecation notes and cross-check each one against how Mailspring actually uses Electron, then report what (if anything) needs updating or hand-verifying.

@indent

indent Bot commented Aug 23, 2026

Copy link
Copy Markdown

I went through the Electron v42 and v43 breaking-change notes line by line and cross-checked each against how Mailspring uses Electron. The v41 changes (PDF WebContents, cookie change cause) are already in master since it's on 41.7.2, so they aren't new here. Nothing in the changelog breaks the app outright, but there are five things worth updating or hand-verifying.

Things to hand-verify

  1. Open-file dialogs now default to the Downloads folder (v43). dialog.showOpenDialog/showSaveDialog now default defaultPath to Downloads when none is passed, and the OS no longer restores the last-used directory between calls. Mailspring's file pickers that pass no defaultPath (attach file at attachment-store.ts:415, signature photo picker, contacts import, thread-list "open", account-sidebar import) will now start in Downloads instead of the last place you were. Attachment save/download dialogs are unaffected because they pass a full defaultPath and track lastDownloadDirectory themselves.

  2. macOS notifications now require code-signing (v42). Electron moved to the UNNotification API; unsigned apps don't show notifications and instead fire the Notification failed event. Signed release builds are fine, but unsigned local/dev builds on macOS will silently stop showing notifications. Worth confirming on a signed macOS build. Minor: the failed handler in notification-ipc.ts:195 is commented "Windows only" but now also fires on macOS.

  3. electron no longer downloads its binary on npm install (v42). The lockfile diff confirms this — hasInstallScript: true is gone from the electron entry and an install-electron bin was added. The binary is now fetched on first npx electron run, and ELECTRON_SKIP_BINARY_DOWNLOAD is no longer honored (the repo doesn't reference it, so no direct break). Dev (npm start) triggers the on-demand download, but please hand-verify CI and the packaging pipeline still obtain the binary as expected.

Something to plan for (not broken by this PR)

  1. Renderer clipboard access is removed in Electron 44. app/src/components/composer-editor/composer-editor.tsx imports clipboard from electron and calls ElectronClipboard.read('public.file-url' / 'FileNameW' / 'text/uri-list') in the renderer (lines 467–472) to detect pasted file paths. This has been deprecated since v40 and is removed in v44 — it still works in 43 (with a deprecation warning), so it's not broken by this PR, but it will break file-paste detection in the composer on the next major upgrade. Plan to move those reads to a preload/contextBridge or @electron/remote before v44. (The direct require('electron').clipboard uses in application.ts and the @electron/remote clipboard uses run in the main process and are fine.)

  2. Frameless windows on Linux (v43), cosmetic. Frameless windows now default to rounded corners on Linux and WCO adopts the native title-bar layout. Mailspring's main/onboarding windows are frameless (window-manager.ts:278), so expect rounded corners on Linux desktops with CSD — worth a quick look on a Linux build.

Checked and not applicable (no usage found): NativeImage.toBitmap()/getBitmap() sRGB normalization, Session.clearStorageData({quotas}) removal, nativeImage.createFromNamedImage array-hslShift deprecation, showHiddenFiles on Linux, offscreen-rendering deviceScaleFactor, and chrome.scripting CSS injection (no extensions).

Net: the bump looks safe to ship. The only code change I'd recommend scheduling (though not blocking this PR) is migrating the composer's renderer clipboard reads before Electron 44.

@bengotow

Copy link
Copy Markdown
Collaborator

Ok great thanks @indent, can you prepare a separate PR migrating the composer's renderer clipboard reads (and any other impacted callsites - check and make sure it's just that one, I suspect there could be others). I'd like to merge that and test it along with these other things so we can get read for Electron 44 all at once.

@bengotow

Copy link
Copy Markdown
Collaborator

I think this list of changes looks good, going to go ahead and merge this one and I'll test these things during the release flow.

@bengotow
bengotow merged commit 292a00f into Foundry376:master Aug 23, 2026
@wrench-exile-legacy
wrench-exile-legacy deleted the electron-43 branch August 23, 2026 23:40
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