Closed Bug 2005885 Opened 10 months ago Closed 4 months ago

Failed Download Not Getting Deleted From Download Menu

Categories

(Firefox for Android :: Downloads, defect)

Firefox 148
All
Android
defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: sunitkrmkr, Assigned: giorga)

References

Details

(Whiteboard: [fxdroid][group4])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Android 13; Mobile; rv:148.0) Gecko/148.0 Firefox/148.0

Steps to reproduce:

In Firefox Nightly Android 148.0a1 (Build #2016131015), open up Downloads menu.
There is one file that failed to download, very long time ago, and it is shown under In progress category, which makes it listed on top of every other item, even though other files have been downloaded more recently.

Clearly I want to clear this failed download so I tap the three dot menu beside the said item and tap Delete.

Actual results:

The Delete option does nothing and the failed download item is not deleted from the list.

Expected results:

The Delete button should delete the said item from list.

The severity field is not set for this bug.
:titouan, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)

I'm having the same issue. I have had this issue for a really long time, probably in the order of year(s). Every once in a while (after a browser update?), a blue dot appears on the triple dot menu button, which draws attention to the Downloads view.

When I open the Downloads view, it shows only one download. The view looks exactly like this:

[arrow back] Downloads
In progress
[circle with exclamation mark inside] gebruikerha...ing-com.pdf [refresh icon] [triple dot menu on download item]
Download failed

When I click on the triple dot menu on the download item, it shows two options: "Share URL" and "Delete".
The "Share URL" menu item works, but the "Delete" button does not work.

I found that the item is listed in /data/user/0/org.mozilla.firefox_beta/databases/mozac_downloads_database . When I exfiltrate that file to my local machine, I can dump its content with sqlite3 mozac_downloads_database .dump, which shows the following content:

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE android_metadata (locale TEXT);
INSERT INTO android_metadata VALUES('en_US_#u-mu-celsius');
CREATE TABLE room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT);
INSERT INTO room_master_table VALUES(42,'c2874ad2eabcf9bddde0fe50ab27cdcb');
CREATE TABLE IF NOT EXISTS "downloads" (`id` TEXT NOT NULL, `url` TEXT NOT NULL, `file_name` TEXT, `content_type` TEXT, `content_length` INTEGER, `status` INTEGER NOT NULL, `destination_directory` TEXT NOT NULL, `created_at` INTEGER NOT NULL, etag TEXT, PRIMARY KEY(`id`));
INSERT INTO downloads VALUES('05fac174-92e8-4a30-9ff3-690ca8dec513','https://www.gebruikershandleiding.com/includes/handleiding_x1.asp','gebruikershandleiding-com.pdf','application/pdf',NULL,5,'Download',1602881811199,NULL);
INSERT INTO downloads VALUES('b104e25f-be2e-42bb-a219-dc602c5749d5','https://www.gebruikershandleiding.com/includes/handleiding_x1.asp','gebruikershandleiding-com.pdf','application/pdf',NULL,5,'Download',1602881833309,NULL);

It is likely that I attempted to download this file in the past, from private browsing mode.

If there are any other relevant files, let me know. I am a Firefox engineer and am able to run arbitrary shell commands and/or JS code in the main process in the context of the Firefox process on the device.

Device: Pixel 8
OS: Android 16
Browser: Firefox Beta 147.0b7

Contents of /data/user/0/org.mozilla.firefox_beta/databases/mozac_downloads_database

I have not tried to repro this in a separate browser, but you could try restoring this file as follows (assuming Firefox Beta):

  1. adb push mozac_downloads_database /sdcard/Android/data/org.mozilla.firefox_beta/
  2. Visit about:debugging on Firefox desktop, connect to the Firefox browser.
  3. IOUtils.copy("/sdcard/Android/data/org.mozilla.firefox_beta/mozac_downloads_database", Services.env.get("GRE_HOME") + "/databases/mozac_downloads_database")
  4. Kill the app and start it.
Duplicate of this bug: 2006143
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(tthibaud)
Whiteboard: [fxdroid][group4]
Duplicate of this bug: 2021004
Assignee: nobody → giorga

I managed to find a reliable way to reproduce the bug.

STR

  • Download a large file (so you have time to pause it before the download completes)
  • Hit pause from the Download notification or the Downloads screen
  • Enable Airplane mode on your device
  • Hit "Resume" from the Download notification or the Downloads screen. The download should fail
  • Force Kill the Fenix app from the Android Settings
  • Open Fenix again, go to the Downloads screen
  • Try to delete the Failed download

Actual behavior:
The file is not deleted

Expected behavior:
The file should be deleted

Hi Gabriel, and Titouan 👋🏼!
Hope both of you are doing :)

Gabriel: Is it possible to covert the changes with tests ? :)
I was trying to add the comment on the patch, but I'm getting this error "Access Denied: D295820 You do not have permission to edit this object."
Not sure if external contributor don't have access to add comment on reviews on phabricator.

Flags: needinfo?(giorga)

I gave you editbugs so you should be able to comment on Phabricator now.

Thanks you so much!!

Pushed by giorga@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4387497f963a https://hg.mozilla.org/integration/autoland/rev/03f491641cb0 Failed Download should be deleted from download menu. r=android-reviewers,tthibaud
Flags: needinfo?(giorga)
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

Verified fixed in Firefox for Android 152.0b4.

After updating, the failed download entry was visible. Clicking Remove in the dot menu did not remove it on the first try, but on the second try it was deleted as desired. After restarting the app, it stayed deleted.

Status: RESOLVED → VERIFIED

In Fireofx 152, I'm still unable to delete an old failed download entry. This doesn't change with browser restart and download retry.

Gabriel, is there any useful info I can share?

Status: VERIFIED → REOPENED
Flags: needinfo?(giorga)
Resolution: FIXED → ---

(I'm able to delete new failed download entires though)

So is the bug still reproducible or not?

Flags: needinfo?(giorga) → needinfo?(denyshon)

It is, with a failed download entry that was created before the fix landed.

Flags: needinfo?(denyshon) → needinfo?(giorga)

I created a download entry before this fix that failed. I updated the app to the latest version. I could delete the file. I need to see how the download item is looking in the database; without this, I can't do anything. If you delete the file from the storage with an app like "Files" from Google. Can you still see the download item in the downloads screen?

Flags: needinfo?(giorga)

I'm going to mark this as fixed again, because I could confirm that the issue was fixed for me, in comment 13. If you are still experiencing the issue it would be a different bug and benefit from its own bug for fix tracking purposes.

If you are still experiencing this issue, please file a new bug with the relevant details. I shared steps on exporting the database in comment 2 and comment 3.

Status: REOPENED → RESOLVED
Closed: 5 months ago → 4 months ago
Resolution: --- → FIXED

Ok, I'll file a new bug. Looks live exporting the database will require some presetup (I have no experience with Android development), so I'll do that later.

Responding to Gabriel's comment, I have a successful download entry for the same file. Maybe that's the key? Deleting the file does not have any visible effect.

Regressions: 2051041

Issue resolved in 151.0.4

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: