Bug 1545793 - Don't put a BITS update in a failure state if the user doesn't have permission to access BITS r=rstrong
authorKirk Steuber <ksteuber@mozilla.com>
Mon, 22 Apr 2019 17:06:59 +0000
changeset 470370 27c8b8f5b3c81e5f216a4ac948c7d082e19fc287
parent 470369 6e95f85fb09f4286e751927b89be768b7a0a4945
child 470371 81021da13bce7f15ef4129ad300af8894cd2af3f
push id35903
push useropoprus@mozilla.com
push dateMon, 22 Apr 2019 21:46:44 +0000
treeherdermozilla-central@a11bd690638f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs1545793
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545793 - Don't put a BITS update in a failure state if the user doesn't have permission to access BITS r=rstrong This patch should prevent a guest user from putting a non-guest user's (existing) BITS download in a failure state. If, however, the guest user is the first user to try BITS, it will fail and will still put BITS in an error state, falling back to nsIIncrementalDownload. Differential Revision: https://phabricator.services.mozilla.com/D28258
toolkit/mozapps/update/UpdateService.jsm
--- a/toolkit/mozapps/update/UpdateService.jsm
+++ b/toolkit/mozapps/update/UpdateService.jsm
@@ -4003,17 +4003,18 @@ Downloader.prototype = {
         } else {
           this._maybeStopActiveNotifications();
         }
 
         Cc["@mozilla.org/updates/update-manager;1"].
           getService(Ci.nsIUpdateManager).saveUpdates();
         this._pendingRequest = null;
       }, error => {
-        if (error.type == Ci.nsIBits.ERROR_TYPE_FAILED_TO_GET_BITS_JOB &&
+        if ((error.type == Ci.nsIBits.ERROR_TYPE_FAILED_TO_GET_BITS_JOB ||
+            error.type == Ci.nsIBits.ERROR_TYPE_FAILED_TO_CONNECT_TO_BCM) &&
             error.action == Ci.nsIBits.ERROR_ACTION_MONITOR_DOWNLOAD &&
             error.stage == Ci.nsIBits.ERROR_STAGE_BITS_CLIENT &&
             error.codeType == Ci.nsIBits.ERROR_CODE_TYPE_HRESULT &&
             error.code == HRESULT_E_ACCESSDENIED) {
           LOG("Downloader:downloadUpdate - Failed to connect to existing " +
               "BITS job. It is likely owned by another user.");
           // This isn't really a failure code since the BITS job may be working
           // just fine on another account, so convert this to a code that