Page MenuHomePhabricator

[desktop] Continue checking for updates even after an exception
AbandonedPublic

Authored by michal on Feb 10 2023, 1:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 1:13 AM
Unknown Object (File)
Fri, Apr 12, 1:13 AM
Unknown Object (File)
Fri, Apr 12, 1:12 AM
Unknown Object (File)
Fri, Apr 12, 1:08 AM
Unknown Object (File)
Mon, Apr 8, 4:06 AM
Unknown Object (File)
Wed, Mar 20, 9:16 PM
Unknown Object (File)
Mar 1 2024, 10:30 PM
Unknown Object (File)
Feb 27 2024, 8:00 PM
Subscribers

Details

Summary

ENG-2923
If checkForUpdates fails because of lack of the internet connection update-not-available won't run and the timer for checking updated won't be restarted. After this diff check for updates will be done continuously and only stopped between update-available and update-downloaded events (so the update won't downloaded multiple times).

Test Plan

Add some logging and check that checkForUpdates is called correctly, even in case of no network connection. Try updating to a new version.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 10 2023, 7:14 AM
Harbormaster failed remote builds in B16322: Diff 22324!
tomek requested changes to this revision.Feb 15 2023, 2:21 AM

How about the case where we detect that an update is available, we stop an interval and then downloading the update fails?

desktop/src/auto-update.js
14

Is it beneficial to introduce a new term schedule? Maybe we can use interval?

20

I'm not sure if I suggested something similar previously, but () => f() could be replaced by just f

This revision now requires changes to proceed.Feb 15 2023, 2:21 AM
desktop/src/auto-update.js
20

Note that this only works if autoUpdater.checkForUpdates is defined as an arrow function instead of a standard class function... otherwise this will be dropped unless you use bind