chore(desktop): upgrade Electron 41.10.7 -> 44.9.3

Merged
KI
1mo ago
+197-35

Update: now Electron 44.9.3

  • 44.9.0 → 44.9.3 for the October 2026 advisories, including the compromised eMudhra intermediate certificates (GHSA-jr5w-w6x2-84p9). Fixes all six open Dependabot electron alerts.
  • Fixed the failing Test job: the test preload's electron mock had no ClipboardItem, so suites that load clipboard-image.ts crashed on import.
  • Screenshots router: both image copies now use writeClipboardImage (clipboard.writeImage is gone in 44).
  • console-message: both listeners use the event-params form; the positional arguments are deprecated and warned on every boot.
  • macOS 12 update gate: Electron 44 needs macOS 13, but electron-builder doesn't put that in latest-mac.yml, so macOS 12 users would install a build that can't launch. A new build-desktop.yml step reads LSMinimumSystemVersion from the packaged app and writes the Darwin version (22.0.0) as minimumSystemVersion. Shipped builds since May (electron-updater 6.8.3) already skip updates on that field.

Tested: dev app over CDP on 44.9.3 (terminal, browser pane, clipboard text and image, console capture, Network Service restart recovery). Packaged unsigned arm64 build boots against production URLs. All four native modules load under Electron 44 (ABI 149). x64 binaries checked statically (no Rosetta on the test Mac). The gate step ran on the real electron-builder layout and survived merge-mac-manifests, and electron-updater's own check skips the update on macOS 12 and offers it on 13+.
Not yet tested (canary after merge): notifications on a signed app, the Squirrel install, terminals surviving the 41→44 update, Intel at runtime.


What & why

Canary got stuck on "can't check for updates": after Chromium's Network Service crashed and restarted mid-session, every update check failed in ~5ms with net::ERR_FAILED until the app was relaunched (21 hours of silent "Update server unreachable, will retry later" in one user's log). Manual "Check for Updates…" reused the same dead session and wrongly reported "No Internet Connection".

Root cause is an Electron bug: ElectronBrowserContext cached each session's URLLoaderFactory and never rebuilt it after the Network Service restarted, so any session created before the restart (here electron-updater's electron-updater partition) fails every net.request/net.fetch forever. Fixed upstream in electron/electron#54908 (42.11.15 / 43.8.0 / 44.8.0+). Electron 41 is out of support and won't get it, so this upgrades to the latest stable, 44.9.0. The bug is not updater-specific — Sentry on persist:superset, the mobile hub, extensions and browser downloads make main-process requests on long-lived sessions too — so the upgrade fixes those as well.

Breaking changes handled

  • 44 – clipboard rearchitecture: clipboard.writeImage is removed and writes return Promises. Image copies (browser-pane screenshot, external.copyImage) go through a new main/lib/clipboard-image.ts that writes an image/png ClipboardItem; writeText calls are awaited.
  • 43 – no binary download in postinstall: the local scripts/postinstall.sh now runs install-electron, so patch-dev-protocol, clean-launch-services and the host-service e2e runner still find node_modules/electron/dist. (Without it, patch-dev-protocol silently skips on the first bun dev.) Packaging is unaffected — electron-builder downloads its own dist.
  • bun minimumReleaseAge: every Electron release carrying the fix is inside the 3-day window, so electron is added to minimumReleaseAgeExcludes (exact pin, same pattern as the existing entries) with a note to remove after 2026-10-20.

Behavior changes to be aware of

  • Electron 44 requires macOS 13+ — macOS 12 users can't run builds from this onward.
  • Electron 43 moves macOS notifications to UNNotification, which requires a code-signed app. Release builds are signed; unsigned local dev builds may not show notifications.
  • Reviewed and not applicable: openAsHidden login items, Sec-Fetch-Dest on net.request, clearStorageData quotas, createFromNamedImage, select-client-certificate, Linux/WCO/ia32 changes. NativeImage.toBitmap() now normalizes color space — used by the dock-icon corner fold; worth a glance at the tinted dock icon.

How I tested it

  • Network Service restart repro (standalone Electron script: net.request on a fromPartition session, SIGKILL the network.mojom.NetworkService process, request again):
    • 41.10.7: net::ERR_FAILED in 0ms, forever (also through real electron-updater 6.8.3 checkForUpdates() against the canary feed)
    • 42.11.15 and 44.9.0: the pre-crash session recovers (302)
  • Clipboard on 44.9.0: wrote a PNG via the new helper, read back image/png + native Apple PNG / TIFF pasteboard types at the right size; writeText/readText round-trip.
  • bun install + install-app-deps native rebuild for 44.9.0 succeed; bun run compile:app succeeds incl. check-pty-daemon-bundle.
  • bun run lint clean. typecheck: the only upgrade-caused errors were the two writeImage removals (fixed); the remaining better-auth/trpc errors are identical with and without this change in my local env.
  • bun test (desktop): identical set of failures on 41.10.7 and 44.9.0 — none introduced.
  • bun dev on 44.9.0: app boots, renderer loads, host-service and pty daemon start, dev bundle renamed to Superset (<workspace>).app, sign-in screen renders. I couldn't sign in (no local API running), so terminals, browser panes, notifications and a packaged auto-update are not yet exercised on 44 — a canary build is the right place for that.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint passes; bun run typecheck has no new errors (see above)
  • "Allow edits from maintainers" is checked on fork PRs (n/a — not a fork)

🤖 Generated with Claude Code


Summary by cubic

Upgrades Electron from 41.10.7 to 44.9.3 so update checks (and other main-process requests on long-lived sessions) stop failing forever with net::ERR_FAILED after Chromium's Network Service restarts. The fix is in 42.11.15 / 43.8.0 / 44.8.0+; Electron 41 is out of support and won't get it, leaving the canary auto-updater stuck until relaunch. 44.9.3 also includes the security fix for compromised eMudhra intermediate certificates (GHSA-jr5w-w6x2-84p9).

Breaking changes handled

  • Electron 44 removed clipboard.writeImage and made clipboard writes async; image copies now go through a new helper writing an image/png ClipboardItem, and writeText calls are awaited.
  • Electron 43 no longer downloads its binary in postinstall; the local scripts/postinstall.sh now runs install-electron so dev scripts still find node_modules/electron/dist.
  • The console-message event now uses the event-params form; both listeners migrated to avoid the deprecation warning on every boot.

Behavior changes

  • Electron 44 requires macOS 13+, and a new CI gate writes minimumSystemVersion into the macOS update manifests so macOS 12 installs skip builds that won't launch.
  • Electron 43 moves macOS notifications to UNNotification, which requires a code-signed app; unsigned dev builds may not show notifications.
  • electron is added to bun's minimumReleaseAgeExcludes until 2026-10-24.
  • Terminals, browser panes, notifications, and packaged auto-update have not yet been exercised on 44.

Summary by CodeRabbit

  • Bug Fixes
    • Image copying from the app and browser screenshots now writes images to the clipboard as PNGs.
    • Copying text and file paths now waits for the clipboard operation to complete, helping ensure copied content is available when the action finishes.
  • Updates
    • Updated the desktop app’s Electron runtime, including security fixes and an improvement related to Network Service restarts.
    • macOS release updates now include minimum system requirements to help determine compatibility.