Closed Bug 1694049 Opened 4 years ago Closed 1 year ago

A mismatch occurs between Retry button and canResume property.

Categories

(WebExtensions :: General, defect, P5)

Firefox 85
defect

Tracking

(firefox136 verified)

VERIFIED FIXED
136 Branch
Tracking Status
firefox136 --- verified

People

(Reporter: topblade71, Assigned: kernp25)

References

Details

(Keywords: dev-doc-complete)

Attachments

(4 files)

Attached image canResume_property.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36

Steps to reproduce:

I tried to resume the failed download through the API.
I used "browser.downloads.search" and "browser.downloads.resume".

Actual results:

canResume property appears false, even though I can resume the download with the retry button for downloads that currently fail with “NETWORK_FAILED”.

This makes it impossible to resume downloading again through the API.

Expected results:

I think this is a parity bug because Chrome supports it.
In Chrome, canResume is true, so it is possible to resume a failed download with downloads.resume

The ability to resume failed downloads through the API would be useful to Firefox.
I hope canResume appears true for the failed download.

Hi,
unfortunately I don't have the technical knowledge to test this on my end, but as a starting point I'll add this ticket to the Core-Networking component.
Thanks.

Component: Untriaged → Networking
Product: Firefox → Core

This seems to be an issue with the webextensions API.

Component: Networking → Untriaged
Product: Core → WebExtensions

Hello,

I’m from QA and I’m attempting to reproduce and confirm the issue you are encountering, but have somewhat limited knowledge of add-on building. Could you by any chance attach the extension you used when you encountered the issue (assuming you called "browser.downloads.search" and "browser.downloads.resume" through an add-on) ?

Thank you !

Flags: needinfo?(topblade71)
Attached file FRX_TEST.zip

(In reply to Alex Cornestean from comment #3)

Hello,

I’m from QA and I’m attempting to reproduce and confirm the issue you are encountering, but have somewhat limited knowledge of add-on building. Could you by any chance attach the extension you used when you encountered the issue (assuming you called "browser.downloads.search" and "browser.downloads.resume" through an add-on) ?

Thank you !

Hello,
I've attached an add-on that I used for testing. (FRX_TEST.zip)
I am using "browser.downloads.search" and "browser.downloads.resume" in resumeDownload of background.js.
Resumption can be controlled through a switch in popup.html.
Thanks.

Flags: needinfo?(topblade71)

canResume's implementation matches the documentation:

A boolean indicating whether a currently-interrupted (e.g. paused) download can be resumed from the point where it was interrupted (true), or not (false).

In Chrome, the documentation is https://developer.chrome.com/docs/extensions/reference/downloads/#type-DownloadItem

True if the download is in progress and paused, or else if it is interrupted and can be resumed starting from where it was interrupted.

In Firefox, the resume() method can actually be called as long as the download hasn't succeeded yet and isn't in progress: https://searchfox.org/mozilla-central/rev/644e42ded761d4f3ce108fa776197730a9a2c535/toolkit/components/downloads/DownloadCore.jsm#335-364

So I suppose that we can change canResume to more closely match the implementation, or at least for network failures.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5

The Bugbug bot thinks this bug should belong to the 'Firefox::Downloads Panel' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Downloads Panel
Product: WebExtensions → Firefox
Component: Downloads Panel → General
Product: Firefox → WebExtensions
Assignee: nobody → kernp25
Status: NEW → ASSIGNED
Attachment #9434650 - Attachment description: Bug 1694049 - Make canResume not false when there is an error which is not USER_CANCELED. r?robwu → Bug 1694049 - Make canResume not false when there is an error which is FILE_FAILED, NETWORK_FAILED and SERVER_FAILED. r?robwu
Attachment #9434650 - Attachment description: Bug 1694049 - Make canResume not false when there is an error which is FILE_FAILED, NETWORK_FAILED and SERVER_FAILED. r?robwu → Bug 1694049 - Make canResume not false when there is an error which is CRASH, FILE_FAILED, NETWORK_FAILED and SERVER_FAILED. r?robwu
Duplicate of this bug: 1467059

The severity field for this bug is set to S4. However, the following bug duplicate has higher severity:

:kernp25, could you consider increasing the severity of this bug to S3?

For more information, please visit BugBot documentation.

Flags: needinfo?(kernp25)
Severity: S4 → S3
Flags: needinfo?(kernp25)

Should the test only make sure that canResume will be true for failed downloads (e.g. NETWORK_FAILED)?

Would this be enough? So people can use browser.downloads.resume for failed downloads.

Flags: needinfo?(rob)
Attachment #9434650 - Attachment description: Bug 1694049 - Make canResume not false when there is an error which is CRASH, FILE_FAILED, NETWORK_FAILED and SERVER_FAILED. r?robwu → Bug 1694049 - Make canResume not false when there is an error which is FILE_FAILED and NETWORK_FAILED. r=robwu
Flags: needinfo?(rob)
Attachment #9434650 - Attachment description: Bug 1694049 - Make canResume not false when there is an error which is FILE_FAILED and NETWORK_FAILED. r=robwu → Bug 1694049 - Make canResume not false when there is an error which is FILE_FAILED and NETWORK_FAILED. r=robwu,mak
Attachment #9434650 - Attachment description: Bug 1694049 - Make canResume not false when there is an error which is FILE_FAILED and NETWORK_FAILED. r=robwu,mak → Bug 1694049 - Make canResume not false when there is a NETWORK_FAILED error. r=robwu,mak
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/68f4e925df45 Make canResume not false when there is a NETWORK_FAILED error. r=robwu,mak
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch

Should the changes_for_add-on_developers section also have some notes about it?

Flags: needinfo?(rob)

Verified as Fixed. Tested on the latest Nightly (136.0a1/20250116214017) and Beta (135.0b5/20250115091607) for comparison, on Windows 10 x64 and Ubuntu 24.04 LTS.

The canResume property is set to true when a download fails with NETWORK_FAILED on the latest Nightly, confirming the fix. See attached screenshot for more details.

Status: RESOLVED → VERIFIED
Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: