[PR #1003] [MERGED] Fix electron app #3460

Closed
opened 2026-02-28 20:41:58 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1003
Author: @Shazib
Created: 5/6/2023
Status: Merged
Merged: 5/18/2023
Merged by: @j-f1

Base: masterHead: fix-electron


📝 Commits (10+)

  • 95bb96c WIP - desktop-electron complains about being unable to find this file in /packages.
  • 70ef029 Add pegjs files to weback config
  • 507a7fd bump electron version
  • f8bb0ab bump electron-builder
  • df50fea bump electron/rebuilder and electron/notarize
  • 7984572 Remove redundant comma
  • cef2387 remove node-ipc
  • 8e47b57 Remove node-ipc package
  • 37f785f Add websockets package
  • d45fada Simplify electron startup

📊 Changes

19 files changed (+2593 additions, -3229 deletions)

View changed files

📝 .gitattributes (+2 -0)
📝 .github/workflows/build.yml (+23 -17)
📝 bin/make-release (+1 -1)
📝 bin/package-electron (+4 -8)
📝 package.json (+1 -1)
📝 packages/desktop-client/src/browser-preload.browser.js (+0 -1)
📝 packages/desktop-client/src/components/manager/ConfigServer.js (+14 -11)
packages/desktop-electron/findOpenSocket.js (+0 -33)
📝 packages/desktop-electron/index.js (+28 -32)
📝 packages/desktop-electron/package.json (+9 -8)
📝 packages/desktop-electron/preload.js (+2 -32)
📝 packages/loot-core/package.json (+2 -2)
📝 packages/loot-core/src/platform/client/fetch/index.web.ts (+77 -72)
📝 packages/loot-core/src/platform/server/connection/index.d.ts (+1 -1)
📝 packages/loot-core/src/platform/server/connection/index.electron.ts (+49 -36)
📝 packages/loot-core/src/shared/environment.ts (+7 -0)
📝 packages/loot-core/webpack/webpack.desktop.config.js (+3 -1)
upcoming-release-notes/1003.md (+6 -0)
📝 yarn.lock (+2364 -2973)

📄 Description

Updates to the latest version of electron and moves the backend-frontend communication from node-ipc to websockets. This resolves the previous roadblock regarding nodeIntegration .

Done

  • Remove node-ipc in favour of websockets.
  • Move file copying out of preload.js to avoid importing module fs there
  • Bump all electron pacakge versions to the latest
  • Added new package for finding open ports as node-ipc is gone
  • Tweaked webpack config for above changes

Partially fixes #468

Questions/ Pending:

  • Literally every single test fails for me, presumably some issue with my setup/environment.
  • The websocket communication is not using TLS. I'm not sure how to enable this, or if we even need to as its all local.
  • Still need to create the CI for building/deploying but I'm not sure where start in this regard as i have no exp with it. Presumably we will need to point the electron auto-updater to the github releases url's. If people are happy with this PR I will look at adding the CI before its merged.
  • In dev mode only, I have disabled TLS security becuase my docker container's cert is not signed. I assume this will be true for other people who spin up the server on thier own hardware. Perhaps I just need to change my cert to one from letsencrypt or something...

Notes.
I have not touched javascript in eons so my apologies if the commit trail is a bit fragmented. I tried to keep them fairly contained and then there is a slightly gnarly final commit fixing all the linter issues... Please let me know if you want me to squash some commits etc.

I initially tried to move this to web workers the same way the web app does it but this was unsuccessful. I have found no way to spin up a worker in one place (frontend/backend) and then pass this worker to the other. The electron ipc channels don't allow you to directly pass objects such as workers, everything is cloned/serialised. Passing a port number so the other end can spin up its own socket works fine.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/1003 **Author:** [@Shazib](https://github.com/Shazib) **Created:** 5/6/2023 **Status:** ✅ Merged **Merged:** 5/18/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `fix-electron` --- ### 📝 Commits (10+) - [`95bb96c`](https://github.com/actualbudget/actual/commit/95bb96cfe6aebb648d93048e1b7ef251e986ffae) WIP - desktop-electron complains about being unable to find this file in /packages. - [`70ef029`](https://github.com/actualbudget/actual/commit/70ef0292c9b876005f714d5a6c0a8a27fb3b2c56) Add pegjs files to weback config - [`507a7fd`](https://github.com/actualbudget/actual/commit/507a7fde81c6967dc9fb3aeca38e053266c0f6be) bump electron version - [`f8bb0ab`](https://github.com/actualbudget/actual/commit/f8bb0ab6205b4af12e689d5510af3d8f73019c9d) bump electron-builder - [`df50fea`](https://github.com/actualbudget/actual/commit/df50fea38961b50850ed8894b1c1070d2c5c2954) bump electron/rebuilder and electron/notarize - [`7984572`](https://github.com/actualbudget/actual/commit/7984572cb6ea3ccb8a8b780a8f1aba1e8c66c8b2) Remove redundant comma - [`cef2387`](https://github.com/actualbudget/actual/commit/cef238783c6c89bcd8148b403e212ca96c495723) remove node-ipc - [`8e47b57`](https://github.com/actualbudget/actual/commit/8e47b57b25863e7045e8a51b614b2ce0d3476190) Remove node-ipc package - [`37f785f`](https://github.com/actualbudget/actual/commit/37f785f48efdd30d781ad3d5885b9e01a8c3e64f) Add websockets package - [`d45fada`](https://github.com/actualbudget/actual/commit/d45fada17ea5223fedd5dd3255a0774ca1000884) Simplify electron startup ### 📊 Changes **19 files changed** (+2593 additions, -3229 deletions) <details> <summary>View changed files</summary> 📝 `.gitattributes` (+2 -0) 📝 `.github/workflows/build.yml` (+23 -17) 📝 `bin/make-release` (+1 -1) 📝 `bin/package-electron` (+4 -8) 📝 `package.json` (+1 -1) 📝 `packages/desktop-client/src/browser-preload.browser.js` (+0 -1) 📝 `packages/desktop-client/src/components/manager/ConfigServer.js` (+14 -11) ➖ `packages/desktop-electron/findOpenSocket.js` (+0 -33) 📝 `packages/desktop-electron/index.js` (+28 -32) 📝 `packages/desktop-electron/package.json` (+9 -8) 📝 `packages/desktop-electron/preload.js` (+2 -32) 📝 `packages/loot-core/package.json` (+2 -2) 📝 `packages/loot-core/src/platform/client/fetch/index.web.ts` (+77 -72) 📝 `packages/loot-core/src/platform/server/connection/index.d.ts` (+1 -1) 📝 `packages/loot-core/src/platform/server/connection/index.electron.ts` (+49 -36) 📝 `packages/loot-core/src/shared/environment.ts` (+7 -0) 📝 `packages/loot-core/webpack/webpack.desktop.config.js` (+3 -1) ➕ `upcoming-release-notes/1003.md` (+6 -0) 📝 `yarn.lock` (+2364 -2973) </details> ### 📄 Description Updates to the latest version of electron and moves the backend-frontend communication from node-ipc to websockets. This resolves the previous roadblock regarding `nodeIntegration` . Done - Remove node-ipc in favour of websockets. - Move file copying out of `preload.js` to avoid importing module `fs` there - Bump all electron pacakge versions to the latest - Added new package for finding open ports as node-ipc is gone - Tweaked webpack config for above changes Partially fixes #468 Questions/ Pending: - Literally every single test fails for me, presumably some issue with my setup/environment. - The websocket communication is not using TLS. I'm not sure how to enable this, or if we even need to as its all local. - Still need to create the CI for building/deploying but I'm not sure where start in this regard as i have no exp with it. Presumably we will need to point the electron auto-updater to the github releases url's. If people are happy with this PR I will look at adding the CI before its merged. - In dev mode only, I have disabled TLS security becuase my docker container's cert is not signed. I _assume_ this will be true for other people who spin up the server on thier own hardware. Perhaps I just need to change my cert to one from letsencrypt or something... Notes. I have not touched javascript in eons so my apologies if the commit trail is a bit fragmented. I tried to keep them fairly contained and then there is a slightly gnarly final commit fixing all the linter issues... Please let me know if you want me to squash some commits etc. I initially tried to move this to web workers the same way the web app does it but this was unsuccessful. I have found no way to spin up a worker in one place (frontend/backend) and then pass this worker to the other. The electron ipc channels don't allow you to directly pass objects such as workers, everything is cloned/serialised. Passing a port number so the other end can spin up its own socket works fine. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:41:58 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#3460