electron API and backend API mismatch #10
r-pankevicius
started this conversation in
General
Replies: 1 comment 2 replies
-
Well, there is one place to catch such changes if writing expected types in TypeScript: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
there are some things that go unnoticed when upgrading electron, but API changes are not reflected in backend API.
Here is one nasty example resulting in auto-update failures.
At some point downloadUpdate method from electron-updater changed the returned value to string array:
https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/AppUpdater.ts#L460
But backend API was not changed:
https://github.com/theolivenbaum/electron-sharp/blob/main/ElectronSharp.API/AutoUpdater.cs#L433
The result is Json serialization exception (expected string, got array) and autoupdate fails to install. This is from
h5.ElectronNET
, but I checked this repo, it's the same.I wonder if it's possible to avoid such errors so TS or C# compiler error will point out electron API changes?
Beta Was this translation helpful? Give feedback.
All reactions