Bug 1707020 - Exit Background Update Task even if we never get a progress update r=nalexander

Differential Revision: https://phabricator.services.mozilla.com/D114029
This commit is contained in:
Kirk Steuber 2021-05-03 18:39:25 +00:00
parent 06ddcdaaad
commit 80d788222c

View File

@ -127,8 +127,8 @@ async function _attemptBackgroundUpdate() {
UpdateService.onlyDownloadUpdatesThisSession = true;
} else if (
status == AppUpdater.STATUS.DOWNLOADING &&
progress !== undefined &&
progressMax !== undefined
(UpdateService.onlyDownloadUpdatesThisSession ||
(progress !== undefined && progressMax !== undefined))
) {
// We get a DOWNLOADING callback with no progress or progressMax values
// when we initially switch to the DOWNLOADING state. But when we get
@ -137,9 +137,9 @@ async function _attemptBackgroundUpdate() {
// we can count on being meaningful, but it will be set to -1 for BITS
// transfers that haven't begun yet.
if (
UpdateService.onlyDownloadUpdatesThisSession ||
progressMax < 0 ||
progress != progressMax ||
UpdateService.onlyDownloadUpdatesThisSession
progress != progressMax
) {
log.debug(
`${SLUG}: Download in progress. Exiting task while download ` +