From 42e2d8fdfaa1396c5fe2f94be0b3cf22d5b92302 Mon Sep 17 00:00:00 2001 From: Robin Steuber Date: Tue, 30 Sep 2025 19:55:20 -0400 Subject: [PATCH] Bug 1946968 - `cleanupDownloadingUpdate` should set aware of the `AUS:currentState` state machine r=cdupuis a=RyanVM DONTBUILD --- toolkit/mozapps/update/UpdateService.sys.mjs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs index 26d633f4f4fe..5d5a3f2c4613 100644 --- a/toolkit/mozapps/update/UpdateService.sys.mjs +++ b/toolkit/mozapps/update/UpdateService.sys.mjs @@ -1374,14 +1374,15 @@ async function cleanupDownloadingUpdate() { // Now trash the update download directory, since we're done with it cleanUpDownloadingUpdateDir(); - // If the update status file says we are downloading, we should remove that + // If the update state says we are downloading, we should change that // too, since we aren't doing that anymore. - let readyUpdateDir = getReadyUpdateDir(); - let status = readStatusFile(readyUpdateDir); - if (status == STATE_DOWNLOADING) { - let statusFile = readyUpdateDir.clone(); + if ( + lazy.AUS.currentState == Ci.nsIApplicationUpdateService.STATE_DOWNLOADING + ) { + let statusFile = getReadyUpdateDir().clone(); statusFile.append(FILE_UPDATE_STATUS); statusFile.remove(false); + transitionState(Ci.nsIApplicationUpdateService.STATE_IDLE); } }