Page MenuHomePhabricator

[desktop] Handle autoUpdate errors

Authored by michal on Mar 10 2023, 8:25 AM.
Referenced Files
Unknown Object (File)
Sat, Nov 18, 6:01 PM
Unknown Object (File)
Sat, Nov 18, 5:39 PM
Unknown Object (File)
Fri, Nov 17, 11:12 PM
Unknown Object (File)
Fri, Nov 17, 11:11 PM
Unknown Object (File)
Sat, Nov 11, 12:55 PM
Unknown Object (File)
Mon, Nov 6, 3:26 AM
Unknown Object (File)
Mon, Nov 6, 3:26 AM
Unknown Object (File)
Mon, Nov 6, 3:25 AM



We want to handle autoUpdate errors (in particular error about no network connection). If we add a listener to an error event electron no longer displays the native alert with the error. Now we can just log it and restart the update schedule.

This replaces D6683 and D6684 as it's a much better solution.

Test Plan

Run the app, turn of internet connection. Check if the error is displayed and the app continues to check for updates.

Diff Detail

rCOMM Comm
Lint Not Applicable
Tests Not Applicable

Event Timeline

29 ↗(On Diff #23607)

Docs says: "Emitted when there is an error while updating."

I am not sure what exactly can cause an error but are we confident that this callback will be called only after checkForUpdates() failure and we that don't need to clear timeout?

I am afraid of causing an update twice when an error was thrown from a different reason than checkForUpdates failure.

Good point, I've added a check that makes sure that the timer doesn't already exist before creating a new one

kamil added inline comments.
18–19 ↗(On Diff #23688)

Will be safer in this order

This revision is now accepted and ready to land.Mar 13 2023, 7:23 AM