Closed Bug 412105 Opened 17 years ago Closed 16 years ago

Don't redownload the file on session restore

Categories

(Firefox :: Session Restore, defect)

x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: mikko, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b2) Gecko/2007121014 Firefox/3.0b2
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b2) Gecko/2007121014 Firefox/3.0b2

Don't start finished download again when Firefox is started

Reproducible: Always

Steps to Reproduce:
1. Download any file (leave tab open)
2. Finish download
3. Close Firefox
4. Start Firefox, restart session
Actual Results:  
Firefox opens the download dialog again for the downloaded file

Expected Results:  
If the download has been succesfully complete, the restore session functionality should have intelligence to check this and not bother the user with unneeded dialog window
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008011223 Minefield/3.0b3pre

I can confirm this.
- set Firefox to restore tabs and windows from last time when it starts 
- go to http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/
- click on a link and confirm download
- close window and cancel the download
- start Firefox, click Tools -> Downloads 
Result: Firefox is happily downloading the canceled download.
Is this what you mean?

It sounds familiar to me; maybe it is a dupe. Confirming for now.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Edward - since when did we resume user canceled downloads? :p

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/toolkit/components/downloads/src/nsDownloadManager.cpp&rev=1.154#712

Canceled downloads do not get DONT_RESUME set.  Or is it that we aren't clearing the entity id when the user cancels it?

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/toolkit/components/downloads/src/nsDownloadManager.cpp&rev=1.154#2417

Maybe have an optional argument there that removes the entity id?
(In reply to comment #2)
> Canceled downloads do not get DONT_RESUME set.  Or is it that we aren't
> clearing the entity id when the user cancels it?
The entityid check is there to make sure it's a real-resumable download (which we don't really need if we don't do fake-resume). So it won't be resuming canceled downloads just because it has an entityid. It'll need to be paused. Otherwise, its autoresume value must be set for some reason.. ?
Firefox will also try to redownload finished downloads on restart. That was the point of the orignal bug report.
(In reply to comment #4)
> Firefox will also try to redownload finished downloads on restart. That was the
> point of the orignal bug report.
>
I tried to reproduce that first, but I couldn't. At least not on Windows. 
Could you give more detailed steps to reproduce?

I quickly tried to repeat this bug on my work computer running Firefox 2.0.0.11/Windows: I couldn't repeat it. Maybe there are some factors involved I am not aware of. I'll try to repeat this again at home where I could succesfully reproduce it.
Firefox 2 doesn't have auto-resume functionality, that I'm aware of; also, you should be trying this in Firefox 3 beta 3 and newer (ftp://ftp.mozilla.org/pub/firefox/nightly/latest-trunk/) builds.
I cannot reproduce this anymore with Firefox 3.0b3. I guess it's fixed somehow with the new download manager.
I also tried reproduce this by leaving a tab containing redirect to download link open, close browser and restart browser w/continued session. Looks like it does not try to redownload files anymore.

It works.

Steps to reproduce (used to fail)

1. Open this link http://sourceforge.net/project/downloading.php?group_id=154155&use_mirror=switch&filename=pys60-1.4.2_src.zip&95215744

2. Download, abort download or do not download

3. Close browser, save tabs

4. Reopen browser

5. No more suggested redownloads, at least with this single test case
I have been seeing this bug for some time.  Every single time I choose restore session, firefox downloads two large files that I successfully downloaded months ago.

Bangs head on desk.
p.s.  If I try to close the download window while this is happening (because it does not paint in the download window for an eternity, so I can't choose cancel), it closes all of firefox.  Meanwhile it doesn't let me do anything in firefox while it is downloading.
Sorry, I should be more organized - while I'm in here, I will note that sometimes I get a restore session question panel even when I closed firefox cleanly the previous time but then shut the system down (properly, using turn off computer) soon afterwards.

This makes me think that firefox is doing a delayed write on shutdown and that does not get completed if the system itself shuts down too soon.  I am not familiar with Windows innards, but shouldn't there be a finalization procedure invoked in system shutdown to make sure applications get their data out?
(In reply to comment #12)
> This makes me think that firefox is doing a delayed write on shutdown and that
> does not get completed if the system itself shuts down too soon.  I am not
> familiar with Windows innards, but shouldn't there be a finalization procedure
> invoked in system shutdown to make sure applications get their data out?
What version of Firefox are you using?
2.0.0.12
For what it's worth, I think this if fixed in Firefox 3.
Component: Download Manager → Session Restore
QA Contact: download.manager → session.restore
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208

-> WORKSFORME
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.