Skip to content

[PM-34331] Update electron to 41#20448

Open
dani-garcia wants to merge 8 commits into
mainfrom
ps/PM-34331-update-electron
Open

[PM-34331] Update electron to 41#20448
dani-garcia wants to merge 8 commits into
mainfrom
ps/PM-34331-update-electron

Conversation

@dani-garcia
Copy link
Copy Markdown
Member

@dani-garcia dani-garcia commented Apr 30, 2026

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-34331

📔 Objective

Update electron to version 41 and the rest of the electron updates to their latest patch, which should solve compilation issues with the latest Visual Studio.

I've also had to enable a new fuse from electron 41, but I just set it to the default value so everything should work the same: https://github.com/electron/fuses/blob/bbf079259e66af30858578a1e070575f11c01915/README.md?plain=1#L29

Note that this will cause the desktop app to start using the bundled node 24, the rest of the clients except CLI are updated as part of #20400

I can't get renovate to create the PR right now so I've created it myself instead.

📸 Screenshots

@dani-garcia dani-garcia added the ai-review-vnext Request a Claude code review using the vNext workflow label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR bumps Electron from 39.8.5 to 41.3.0 (skipping 40) along with the related toolchain (electron-builder 26.8.2 → 26.9.0, electron-updater 6.6.4 → 6.8.3, @electron/notarize 3.0.1 → 3.1.1, @electron/rebuild 4.0.3 → 4.0.4) and package-lock.json. Both electron-builder.json and electron-builder.beta.json now pin electronVersion to 41.3.0, resolving the prior beta-config drift. A new WasmTrapHandlers fuse required by Electron 41 (under strictlyRequireAllFuses: true) is added in apps/desktop/scripts/after-pack.js at its documented default value. A window.main.ts change adds a concurrency guard so overlapping reload-process IPC events from LockService no longer race the crash + reload sequence, plus a one-tick setImmediate yield as a workaround for electron/electron#48661.

Code Review Details

No new findings. The previously raised IMPORTANT finding on apps/desktop/electron-builder.beta.json is resolved, and the additional window.main.ts reload-process fix is well-scoped (try/finally lock, explicit comment on the Electron upstream issue, and enableRendererProcessForceCrashReload path preserved).

Dependency Changes

Package Change Ecosystem
electron 39.8.5 → 41.3.0 (major) npm
electron-builder 26.8.2 → 26.9.0 npm
electron-updater 6.6.4 → 6.8.3 npm
@electron/notarize 3.0.1 → 3.1.1 npm
@electron/rebuild 4.0.3 → 4.0.4 npm

Comment thread apps/desktop/electron-builder.json
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.41%. Comparing base (672a54f) to head (e411f19).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/desktop/src/main/window.main.ts 0.00% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20448      +/-   ##
==========================================
- Coverage   47.41%   47.41%   -0.01%     
==========================================
  Files        3994     3994              
  Lines      122774   122782       +8     
  Branches    18881    18882       +1     
==========================================
  Hits        58212    58212              
- Misses      60153    60161       +8     
  Partials     4409     4409              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dani-garcia dani-garcia requested a review from a team as a code owner April 30, 2026 11:59
@dani-garcia dani-garcia requested a review from djsmith85 April 30, 2026 11:59
djsmith85
djsmith85 previously approved these changes May 4, 2026
Copy link
Copy Markdown
Contributor

@djsmith85 djsmith85 left a comment

Choose a reason for hiding this comment

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

Changes are looking great, but we should get #20400 merged first. Since everyone needs to update their node-version for development.

@dani-garcia
Copy link
Copy Markdown
Member Author

The last commit is fixing a process reload bug reported in https://bitwarden.atlassian.net/browse/PM-36851
The fix is at: 6e5f549?w=1

The bug appeared in electron 41 and caused process reload to crash the renderer, but then not reload the page, leaving the window empy and stuck. This issue is caused by two conditions:

@SuperSandro2000
Copy link
Copy Markdown

Electron 39 went EOL 2 weeks ago and we want to switch to 40 or 41 in nixpkgs. Will this land with the next desktop release?

@dani-garcia
Copy link
Copy Markdown
Member Author

Hey @SuperSandro2000, I believe today is the RC cut for the desktop release next week, so I don't think this will make it on time for next update. We had some QA issues on Linux when using electron 41, which is the cause for the delay.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants