Closed Bug 1977912 Opened 1 year ago Closed 1 year ago

[Downloads v2] Remove direct updates to `DownloadUIStore` from download control actions

Categories

(Firefox for Android :: Downloads, task)

All
Android
task

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: npoon, Assigned: npoon)

References

Details

(Whiteboard: [fxdroid][group4])

Attachments

(3 files)

Currently, when the user pauses / resumes / restarts / deletes / retries a download, the DownloadUIStore updates it's items property, while also sending a broadcast to the AbstractFetchDownloadService, which notifies the BrowserStore of the change. The DownloadUIState is the state that directly determines what is shown in the UI. The expected behaviour is that the browser store gets updated, and since the DownloadUIStore observes the browser store, it knows to update the UI based on the "backend" state. Thus, we should remove our updates to the DownloadUIStore.

A side effect of this bug is Bug 1977393. When Fenix is killed, the DownloadUIStore is disconnected from the AbstractFetchDownloadService and while the play / pause / resume / retry buttons have their state updated, this actually doesn't reflect the current state, which causes the user perception of unresponsiveness.

Ideally, we should find a way to reconnect the service when Fenix is opened again but this is a deep rooted problem in the AbstractFetchDownloadService so we will investigate how to reconnect the service in Bug 1977835. Temporarily, our solution is to just cancel all of the downloads when Fenix is killed

Summary: [Downloads v2] Remove → [Downloads v2] Remove direct updates to `DownloadUIStore` from download control actions
Pushed by npoon@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/58290bb7fc1d https://hg.mozilla.org/integration/autoland/rev/87d17f1f1c66 Part 1: Remove direct updates to `DownloadUIStore` from download control actions r=android-reviewers,tthibaud https://github.com/mozilla-firefox/firefox/commit/614f6f7266f7 https://hg.mozilla.org/integration/autoland/rev/e7cc758d8207 Part 2: Update KDocs in DownloadState and DownloadUIAction r=android-reviewers,tthibaud https://github.com/mozilla-firefox/firefox/commit/d0dc1b3ead00 https://hg.mozilla.org/integration/autoland/rev/84fa57ee33db Part 3: Refactor DownloadFragment.openFile and remove FileItem.Status.toDownloadStateStatus r=android-reviewers,tthibaud
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: