Closed Bug 1668096 Opened 8 months ago Closed 7 months ago

Replace activeUpdate with downloadingUpdate and readyUpdate


(Toolkit :: Application Update, task, P1)




83 Branch
Tracking Status
firefox83 --- fixed


(Reporter: bytesized, Assigned: bytesized)




(2 files)

One of the biggest barriers to being able to download multiple updates per Firefox session (Bug 353804) is how the Updater is currently structured around a single activeUpdate. In order to remove this barrier, I intend to remove activeUpdate and replace it with downloadingUpdate and readyUpdate.

This change should be doable, even separately from the rest of the changes needed for Bug 353804. We don't necessarily need to have two updates at a time to have a separate variable for updates that are downloading and for updates that have downloaded.

This will require sorting through the many existing usages of activeUpdate to determine which ought to access the downloadingUpdate and which ought to access the readyUpdate.

Priority: -- → P1

This patch does not make the necessary replacement in tests. Those changes will be made in a later patch in this stack.

Some additional, related changes are also made in this patch:
cleanupActiveUpdate is being replaced with cleanupDownloadingUpdate and cleanupReadyUpdate. The two new functions currently do very similar things, but separating them will allow us to have each function clean up the right update, once we fully support more than one update per session.
The old mechanism to add something to the update history was for it to be assigned to activeUpdate, and then to assign null to activeUpdate. We now need to assign active updates to be null without adding them to the history. As an example, we need to set downloadingUpdate to null when the download completes, but it shouldn't be added to the history at that point. To address this, an explicit addUpdateToHistory function has been added, and assigning null to either active update variable no longer moves the update to the update history.

Pushed by
Replace activeUpdate with downloadingUpdate and readyUpdate r=mhowell,preferences-reviewers
Replace activeUpdate with downloadingUpdate and readyUpdate in tests r=mhowell
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.