From 80d788222cf030a16d7adc8aed5bd0ebfae1b2f2 Mon Sep 17 00:00:00 2001 From: Kirk Steuber Date: Mon, 3 May 2021 18:39:25 +0000 Subject: [PATCH] Bug 1707020 - Exit Background Update Task even if we never get a progress update r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D114029 --- .../mozapps/update/BackgroundTask_backgroundupdate.jsm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolkit/mozapps/update/BackgroundTask_backgroundupdate.jsm b/toolkit/mozapps/update/BackgroundTask_backgroundupdate.jsm index e3fc3c3b8c6a..2b9ab7e81dcd 100644 --- a/toolkit/mozapps/update/BackgroundTask_backgroundupdate.jsm +++ b/toolkit/mozapps/update/BackgroundTask_backgroundupdate.jsm @@ -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 ` +