actual icon indicating copy to clipboard operation
actual copied to clipboard

[Feedback] Electron/Desktop App

Open Shazib opened this issue 1 year ago • 38 comments

Experimental builds of the Electron-based desktop app are now available with every change we make to Actual. Go to this GitHub Actions page, click on the top entry, make sure you’re logged into GitHub, and then click on the link for your platform under “Artifacts.” Make sure to read the below warnings before proceeding.

Known issues/warnings:

  • The Electron app has more permissions than the web client by virtue of being a desktop app. While we will do our best to avoid bugs that affect your wider system, make sure you have a good backup system set up on your computer before using the desktop app.
  • The app binaries are currently not code signed, so you may need to bypass your operating system’s security warnings in order to get the app to run. Don’t trust random strangers on the internet who tell you to do this! If you build and run the Electron app locally instead of using the pre-built artifact downloads you won’t have to override security settings.
  • There are not yet official/stable releases of the desktop app, and it will not auto-update.
  • If you want to use both the web and Electron clients, we recommend using the :edge version of the server to ensure both clients are at the very bleeding edge. If you don’t do this, you may run into “out-of-sync migrations” errors on the web client.

We hope to clean up all of these loose ends (along with any bugs you identify) before making a stable release of the Electron app. In the future, we will do our best to release Electron app updates at the same time as all other package updates.

[added by maintainers]


Opening this issue to record issues and to-do items for the electron app.

Issues

  • [x] Side-Nav broken (reported by Matiss)
  • [x] Crashes when clicking 'Rules' (maybe not an issue?? can't reproduce)
  • [x] Middle click on sidebar opens empty windows.
  • [x] Opening Reports page results in two network-failure events
  • [x] 'Learn More' in settings doesn't work
  • [x] 'Release Notes' in settings doesn't work
  • [x] 'Find schedules' blanks out page behind it while modal is opened from menu bar
  • [x] 'Repair Split Transaction' in 'Tools' menu doesn't do anything?
  • [x] Create Backup/Load from Backup broken
  • [x] Broken sockets when reloading
  • [x] Fix the 'find schedules' menu option.
  • [ ] Check anywhere new/malloc may be allocating memory outside the v8 sandbox. See #1238
  • [ ] Add the 'fix split transactions' menu item back in?

macOS Issues (Help Needed)

  • [x] Top of sidebar overlaps with window controls on macOS
  • [x] Jank when mousing between area under hidden titlebar/toolbar and window content area on macOS

To Test

  • [x] Nordigen integration (only works with a server)
  • [ ] Goal Templates
  • [x] All basic functionality...?
  • [ ] Tester needed for Linux and OS X
  • [x] ~~Electron Auto-Updater?~~

Future Items

  • [x] ~~Investigate codesigning/deploying to Mac/Windows/Linux stores~~
  • [x] ~~Add releases to Github...~~

image

Shazib avatar May 18 '23 23:05 Shazib

I am downloading Ubuntu, will spin it up in Hyper-V this evening and give this a shot

Windows version is pretty tight, couldn't find any immediate issues other than the ones highlighted.

rich-howell avatar May 19 '23 06:05 rich-howell

I cant connect to my server via reverse proxy because the cert isn't known (my best guess). In a browser I just have to click the proceed button, but there isn't an option to do that in the ubuntu app.

If I use an IP address it works fine if I use http.

youngcw avatar May 26 '23 16:05 youngcw

Goal templates seem to be working fine on the ubuntu version.

youngcw avatar May 26 '23 16:05 youngcw

I cant connect to my server via reverse proxy because the cert isn't known (my best guess). In a browser I just have to click the proceed button, but there isn't an option to do that in the ubuntu app.

If I use an IP address it works fine if I use http.

Yeah I'm trying to see if I can get node to pop up some kind of 'accept certificate' message or something (fire some callback) but haven't cracked it as yet. Electron has a function for it but the issue is in the backend not electron.

Shazib avatar May 26 '23 19:05 Shazib

[bug report] The build artefact for macosx does not seem to work. I think websockets are not running?

in.4a5f855a.js:2 WebSocket connection to 'ws://localhost:64796/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Repro:

  1. download the artefact here https://github.com/actualbudget/actual/actions/runs/5148653600
  2. install it
  3. launch it
  4. observe a never ending loading spinner

What's weird is.. sometimes the app works. Other times it does not and it is just stuck.

MatissJanis avatar Jun 02 '23 18:06 MatissJanis

[bug report]

The build artefact for macosx does not seem to work. I think websockets are not running?


in.4a5f855a.js:2 WebSocket connection to 'ws://localhost:64796/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Repro:

  1. download the artefact here https://github.com/actualbudget/actual/actions/runs/5148653600

  2. install it

  3. launch it

  4. observe a never ending loading spinner

What's weird is.. sometimes the app works. Other times it does not and it is just stuck.

Unfortunately I don't have a Mac to test but one thing that comes to mind with this being intermittent is that perhaps the port it's choosing for the socket is not actually free (or reserved etc)?

Shazib avatar Jun 02 '23 19:06 Shazib

(I might be wrong)

Could the problem be that multiple sockets get opened up? I am able to reliably reproduce if I open up the app and then do "cmd+r" (refresh).

--

One more bug: it's not possible to connect it to a remote server. I think the child process does not have network access.

FetchError: request to https://xxxxxxxxx/info failed, reason: connect ENETUNREACH

Update: this actually might be a fly-io exclusive issue. Debugging if there is a solution.. https://community.fly.io/t/error-connect-ehostunreach-when-sending-requests-to-my-fly-io-app/5686/30?page=2

MatissJanis avatar Jun 02 '23 20:06 MatissJanis

Yep! The front/client end does reconnect on a Ctrl+R, and fails. The ws server keeps running so it should just close the client connection and open a new one on the same port.

I think maybe i need to call close on the socket before it opens a new one, but I'll have to figure out where in react-land to place that call.

Shazib avatar Jun 03 '23 00:06 Shazib

Update on ENETUNREACH issue: my network does not have ipv6. However, node-fetch was for some reason trying to use it.. thus it was blowing up. Very strange.. but explicitly turning off ipv6 in my local network settings seems to have fixed the problem for me.

MatissJanis avatar Jun 04 '23 19:06 MatissJanis

Do we need to implement something in-app to cope with this? i.e. fallback to ipv4 if 6 fails or something?

Shazib avatar Jun 04 '23 20:06 Shazib

Do we need to implement something in-app to cope with this? i.e. fallback to ipv4 if 6 fails or something?

This might just be with weird network configuration. So I would recommend NOT doing anything for now. And to wait and see if others run into the same problem.

MatissJanis avatar Jun 04 '23 20:06 MatissJanis

Thanks for working on this @Shazib. I much prefer to use the desktop app and really struggled to get it building in CI so glad to see it working again.

TomAFrench avatar Jun 28 '23 16:06 TomAFrench

Creating/Loading backups & Rules seem to be pretty solid, so i've gona ahead and marked them off on here.

Shazib avatar Jun 29 '23 21:06 Shazib

Just finished testing the electron app again. Very exciting to see all the progress! I think we'll be able to start doing official beta releases for it very soon to get some more feedback.

Some bugs spotted (all on mac os):

  • [x] the minimize/maximize osx icons overlay the budget name (possibly missing some top padding? or maybe a toggle to turn on top-bar?)
Screenshot 2023-07-29 at 12 03 22

For comparison: other apps have this top-bar:

Screenshot 2023-07-29 at 12 11 18
  • [x] when you collapse the side-nav - it's very difficult to bring it back open (very likely the same root cause same as the report above)
  • [ ] export data is not working - clicking "export" crashes the websocket connection making the app unusable
  • [ ] closing the app and re-opening for some reason forces me to select my "active budget" once more - instead it should remember the previously active budget and just show that

MatissJanis avatar Jul 29 '23 11:07 MatissJanis

Ditto the above from my testing a couple of weeks back (at least for the Mac version).

I went back to running Actual as a desktop app using Unite 4 (https://www.bzgapps.com/). But I cannot do exports from that either.

Kidglove57 avatar Jul 29 '23 11:07 Kidglove57

Thanks @MatissJanis @Kidglove57, Unfortunately i dont have a Mac so can't work on any of the macOS specific bugs, but i will check all of these against the windows version and try to solve them there.

Shazib avatar Jul 29 '23 17:07 Shazib

Small improvement for exporting: https://github.com/actualbudget/actual/pull/1468

Now if the export fails we will show a nice error message + will not crash the websockets. But this is still not really solving the export functionality (couldn't figure that out yet..)

MatissJanis avatar Aug 05 '23 20:08 MatissJanis

This PR might solve our issue though: https://github.com/WiseLibs/better-sqlite3/pull/1036

I'll wait for it to be merged and released before continuing investigations.

MatissJanis avatar Aug 05 '23 20:08 MatissJanis

@MatissJanis Could the work i did in this PR be of use here?

Shazib avatar Aug 05 '23 20:08 Shazib

@MatissJanis Could the work i did in this PR be of use here?

What do you mean? That PR is already merged and in master.

MatissJanis avatar Aug 05 '23 20:08 MatissJanis

@MatissJanis Could the work i did in this PR be of use here?

What do you mean? That PR is already merged and in master.

Is the underlying problem a similar issue? That we can't call functions allocating memory outside the sandbox?

Shazib avatar Aug 05 '23 20:08 Shazib

Is the underlying problem a similar issue? That we can't call functions allocating memory outside the sandbox?

AFAIK: yes. Both serialize and backup is breaking because of memory caging. Though I might be totally wrong as my understanding here is based only off of half a days worth of research.

MatissJanis avatar Aug 05 '23 20:08 MatissJanis

Is the underlying problem a similar issue? That we can't call functions allocating memory outside the sandbox?

AFAIK: yes. Both serialize and backup is breaking because of memory caging. Though I might be totally wrong as my understanding here is based only off of half a days worth of research.

Could the solution be to re-use the exportDatabase function i wrote there instead of cloudStorage.exportBuffer when running in electron?

Shazib avatar Aug 05 '23 20:08 Shazib

Could the solution be to re-use the exportDatabase function i wrote there instead of cloudStorage.exportBuffer when running in electron?

cloudStorage.exportBuffer is internally calling exportDatabase. And then the process hangs on db.backup here.

Edit: I also tried changing db.backup to db.serialize and I got basically the same result. db.backup throws an exception that it is not able to ~find the database~ open the database (which is in-memory btw). Whereas db.serialize actually just hangs. I suspect they both have the same root-cause issue.

MatissJanis avatar Aug 05 '23 20:08 MatissJanis

Goal templates seem to be working fine on the ubuntu version.

I've been using the electron app on Windows for a couple months now and goal templates are working the same as the Web version.

shall0pass avatar Aug 06 '23 14:08 shall0pass

Is the build no longer being generated? Can't seem to find any electron related artifacts in the linked actions page.

thelazyoxymoron avatar Sep 22 '23 07:09 thelazyoxymoron

Is the build no longer being generated? Can't seem to find any electron related artifacts in the linked actions page.

I can still see them for PR's

Shazib avatar Sep 22 '23 17:09 Shazib

Socket reconnection has been merged and should be available in edge. Which means you should be able to use the electron app - make your computer go to sleep - and the app should still continue working after the computer starts up.

With this: I think all the issues have been resolved. Next we need to figure out a release process, signing, publishing to marketplaces, etc.

MatissJanis avatar Oct 06 '23 21:10 MatissJanis

@MatissJanis amazing work!

Regarding windows builds, I think if you deploy to the Microsoft store, you do not need an expensive codesigning certificate from a verified authority, you upload the build to the store, and then they (microsoft) sign it with thier own certificate.

You need to create a certificate and sign the build you send to them, but this cert can be locally generated for free, as long as its linked with your developer account - so they can make sure you uploaded the build.

Actual would need an 'organisation' app developer account which is a one-off lifetime fee of $99.

Of course this means that the builds distributed on github are signed but not verified. (but maybe we accept that for now, as the cost is quite a lot).

Apple I assume just requires a developer account?

Shazib avatar Oct 06 '23 21:10 Shazib

@youngcw FYI, on linux, I was able to connect to my instance behind a self-signed cert by setting the following environment variable:

NODE_TLS_REJECT_UNAUTHORIZED=0 ./Actual-23.11.0-x86_64.AppImage

hackoder avatar Nov 05 '23 18:11 hackoder