Closed Bug 1819001 Opened 3 years ago Closed 13 days ago

[Downloads v2] download can not resume

Categories

(Firefox for Android :: Downloads, defect, P3)

Firefox 112
All
Android
defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: xl19870217, Assigned: titouan)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid] [group4])

Attachments

(8 files)

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

Steps to reproduce:

pause downlaod status, then resume downlad file. it will failed.
https://romspure.cc/download/metal-gear-solid-3-snake-eater-16042/2
it is well when i use chrome browser.

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)

The described problem doesn't seem to be Android related. It also appears on the desktop version, so it might be an error that is thrown from Gecko.
I did a small investigation and I'll be adding some screen records and some logs that might be helpful when investigating further.

Flags: needinfo?(cpeterson)
Severity: -- → S3
Component: General → Downloads
Blocks: 1948708
Priority: -- → P3
Whiteboard: [fxdroid] [group4]
Summary: download can not resume → [Downloads v2] download can not resume

I think the problem is we put the "Range" header value when the download is resumed, but the website doesn't respond with the "Content-Range" header value.
The response should be 206 from the resume, but the site response is 200, like we made the request from the beginning.
The same bug is on desktop. On Chrome or Brave I can't reproduce this bug.
Tried with HttpURLConnectionClient() instead of GeckoViewFetchClient still the same result.

Depends on: 1960870
No longer depends on: 1960870
See Also: → 1960870

This issue no longer reproduces on the latest builds of Firefox for Android Nightly 152, Beta 151, or RC 150.0.1.
Tested with Motorola Moto g30 (Android 12), and Pixel 6 (Android 17).
Closing as WORKSFORME.
Feel free to file a mew issue, if encountered again.

Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Flags: needinfo?(xl19870217)
Resolution: --- → WORKSFORME

I can still reproduce the bug. I have a clear STR that always works for me:

STR

  • have a local folder, with a 500Mb file for example (that can be downloaded from here)
  • open a terminal in this folder and run python3 -m http.server
  • on your Android device, open Fenix and load 192.168.1.x:8000 and download the file (you need to figure out the local ip of your machine running the local server. On a mac, you can run ipconfig getifaddr en0;)
  • pause the download before it completes
  • resume the download

Expected behavior

  • The download resumes

Actual behavior

  • The download fails
Status: RESOLVED → REOPENED
Ever confirmed: true
Flags: needinfo?(xl19870217)
Resolution: WORKSFORME → ---

When resuming a paused download, servers may ignore the Range request and respond with 200 OK instead of 206 Partial Content. Treat that as a fresh download instead of failing: reset copied byte state, attempt to delete the partial file, and write without appending.

Keep invalid resume responses failing, including 206 responses without Content-Range.

Assignee: nobody → tthibaud
Pushed by tthibaud@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3646139bf45c https://hg.mozilla.org/integration/autoland/rev/2654c1ea107c Part 1: Refactor Downloads resume logic before fixing a Download resume issue. r=android-reviewers,calu
Pushed by tthibaud@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/560649d10e02 https://hg.mozilla.org/integration/autoland/rev/7a2c34e91ca2 Part 2: Restart downloads when resume response ignores Range. r=android-reviewers,calu
Status: REOPENED → RESOLVED
Closed: 2 months ago13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: