Closed Bug 906681 Opened 12 years ago Closed 12 years ago

Fix imported target path and state of paused downloads

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

Attachments

(1 file, 1 obsolete file)

In the new DownloadImport module, paused downloads were imported into a state from which they couldn't be restarted, and with the URI path instead of the file path for the target.
Attached patch bug-906681.diff (obsolete) — Splinter Review
This fixes this issue, and also prevents downloads that never started from being restored in a stopped state. This is done by never serializing "stopped" but only the "succeeded", "canceled", and "error" properties.
Attachment #792207 - Flags: review?(enndeakin)
Comment on attachment 792207 [details] [diff] [review] bug-906681.diff > let propertiesToDeserialize = [ >+ "succeeded", >+ "canceled", >+ "error", > "startTime", > "totalBytes", > "hasPartialData", > "tryToKeepPartialData", > "launcherPath", > "launchWhenSucceeded", > "contentType", > ]; > Would it be worth it to define this list once and shared with toSerializable since the list is the same except for "error"?
Attachment #792207 - Flags: review?(enndeakin) → review+
Attached patch Updated patchSplinter Review
Attachment #792207 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Do you have a scenario which reproduced the issue? I tried the following steps: 1. Launch an older version of Firefox (prior of landing the Downloads.jsm) - e.g. August the 5th Nightly 2. Start downloading a large file 3. Pause the download 4. Close Firefox 5. Launch a Firefox version which uses Downloads.jsm (I used August 18 Nightly), using the same profile as in step 1 6. Open the Downloads Panel, right click on the paused download (from step 3) and resume the download Result: Download is successfully resumed. When was the DownloadImport module introduced?
Flags: needinfo?(paolo.mozmail)
The steps to reproduce look good, with the addition that to reproduce the original issue the full target path (directory or file name) of the download should contain spaces (or other special characters that are percent-encoded in URLs). This is usually true on Windows with default user profile paths. The DownloadImport module was first introduced in bug 851466.
Flags: needinfo?(paolo.mozmail)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: