Skip to content

chore: upgrade Electron from EOL 39 to a supported version #1118

Closed

Description

@Astro-Han

Background

Current: electron@^39.2.7 (locked 39.8.10).

Electron 39 reached end-of-life on 2026-05-05. Electron's support policy only covers the latest three stable major versions (currently 41.x / 42.x / 43.x). As of July 2026, Electron 39 is no longer receiving Chromium security fixes.

This is a material concern for Maka because the desktop app is a browser shell that loads remote content and runs provider traffic.

Current gap

  • Electron 39.8.10 → latest 43.1.1 (four major versions behind).
  • Node.js in the main process: 39 ships Node 22.20; 40+ likely bump the Node version.

Upgrade paths

  1. Staged: 39 → 40 → 41 → 42 → 43, one major per PR, validating at each step.
  2. Direct: 39 → 43 in one PR, accepting the larger breaking-change surface.

Things to validate

  • Native deps (node-pty, esbuild) against the new Node/Electron version.
  • Electron API deprecations/removals between 39 and 43.
  • Security defaults (sandbox, contextIsolation, CSP).
  • Renderer behavior changes with the Chromium version jump.
  • Full build and the Playwright E2E suite.

Proposal

  • Open a worktree chore/electron-43-upgrade.
  • Bump Electron and any related devDependencies (e.g., @playwright/test if its Chromium version needs alignment).
  • Run npm run build, npm run test, and representative E2E smoke tests.
  • Decide staged vs. direct based on the first major's breakage surface.

Activity

  1. added
    enhancement
    on Jul 16, 2026
  2. M4n5ter commented on Jul 16, 2026

    @M4n5ter
    Member

    @Astro-Han

    English

    I took a closer look at this issue and ran a temporary direct upgrade from Electron 39.8.10 to 43.1.1 on the current main.

    I did not find a blocker for upgrading directly to 43:

    • the repository build passed;
    • all 2,571 Desktop tests passed;
    • all 25 Electron E2E tests passed;
    • all 19 embedded-browser/CDP smoke checks passed;
    • [email protected] successfully spawned, produced output, and exited under Electron 43.1.1 / Node 24.18.0.

    Based on this result, one direct 39 → 43 upgrade looks preferable to separate upgrades through every intermediate major.

    A few details are worth adjusting or covering during review:

    • The locked Electron 39.8.10 contains Node 22.22.1; Electron 43.1.1 contains Node 24.18.0.
    • esbuild runs during the host build and does not share Electron's native ABI, so it does not appear to require a coordinated upgrade.
    • Playwright launches the Electron executable installed by this project. The current @playwright/[email protected] passed the Electron 43 E2E suite, so there is no observed reason to change it as part of this upgrade.
    • Electron 42 moved binary download from postinstall to first invocation. The local installation and launch path worked, but Linux CI should still verify this path.
    • Electron 43 changes dialogs without defaultPath to start in Downloads instead of remembering the OS's previous directory. Several Maka open dialogs are affected, so this deserves explicit manual verification.
    • Electron 42 changed macOS notifications to UNNotification, which makes signed-build notification behavior another manual verification item.

    The embedded browser does load arbitrary HTTP(S) content, so the security motivation is valid. Its existing sandbox, context-isolation, permission, download, and visible-lease backstops all passed under Electron 43.

    简体中文

    我仔细看了一下这个 issue,并基于当前 main 在临时 worktree 中做了 Electron 39.8.10 → 43.1.1 的直接升级验证。

    目前没有发现阻碍直接升级到 Electron 43 的问题:

    • 根级构建通过;
    • Desktop 2,571 项测试全部通过;
    • Electron E2E 25 项全部通过;
    • 嵌入式浏览器/CDP smoke 19 项全部通过;
    • [email protected] 在 Electron 43.1.1 / Node 24.18.0 下能够正常启动、产生输出并退出。

    基于这些结果,直接用一次升级完成 39 → 43,看起来比逐个经过中间 major 更合适。

    有几个细节建议在实现或审查时调整、补充:

    • 当前锁定的 Electron 39.8.10 实际搭载 Node 22.22.1;Electron 43.1.1 搭载 Node 24.18.0。
    • esbuild 运行在宿主构建阶段,不共享 Electron native ABI,看起来不需要联动升级。
    • Playwright 会启动项目安装的 Electron。当前 @playwright/[email protected] 已能完整通过 Electron 43 E2E,因此目前没有观察到需要随本次升级一同调整它的原因。
    • Electron 42 将二进制下载从 postinstall 移到了首次调用。本地安装与启动路径正常,但仍应交给 Linux CI 再验证一次。
    • Electron 43 会让未指定 defaultPath 的文件对话框从 Downloads 开始,而不再沿用 OS 上次使用的目录。Maka 有几个 open dialog 会受影响,适合列入人工验证。
    • Electron 42 将 macOS 通知迁移到 UNNotification,签名构建中的通知行为也应人工确认。

    嵌入式浏览器确实会加载任意 HTTP(S) 内容,因此 issue 中的安全动机成立。现有 sandbox、context isolation、权限、下载和 visible lease backstop 在 Electron 43 下均通过验证。

  3. added a commit that references this issue on Jul 16, 2026
    b927d63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions