Closed
Bug 405107
Opened 17 years ago
Closed 17 years ago
File->Save Page As... download often reports 0 bytes as saved
Categories
(Toolkit :: Downloads API, defect, P2)
Toolkit
Downloads API
Tracking
()
VERIFIED
FIXED
mozilla1.9beta3
People
(Reporter: martijn.martijn, Assigned: Mardak)
References
()
Details
Attachments
(1 file, 3 obsolete files)
4.56 KB,
patch
|
Details | Diff | Splinter Review |
To reproduce:
- Visit http://www.google.nl/firefox (although it seems to happen on every page)
- Do "File->Save Page As..."
Expected result:
- Page should be saved, reported amount of bytes saved should at least be > 0 bytes.
Actual result:
0 bytes saved as reported by the download manager.
It seems to happen when I first have visited the page.
I can look for a regression range, if wanted.
Flags: blocking-firefox3?
Comment 1•17 years ago
|
||
A regression range would be awesome if you could get it.
Edward - any thoughts on this off the top of your head?
Reporter | ||
Comment 2•17 years ago
|
||
Sorry, this isn't a real regression, this started happening as soon as bug 223895 was fixed.
Fyi, when I do a replace of the old saved file, you can't see the bug, e.g. the correct size is being reported.
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P2
Updated•17 years ago
|
Whiteboard: [needs patch][needs assignee]
Target Milestone: --- → Firefox 3 M11
Assignee | ||
Comment 3•17 years ago
|
||
The issue here is that webbrowserpersist actually gives us multiple start/stops for each thing it's downloading from the page. So probably an image is getting saved before the actual html page that we're looking for the file size of.
Comment 4•17 years ago
|
||
So, what our our options here to deal with the issue of the webbrowserpersist giving us multiple start/stops?
Whiteboard: [needs patch][needs assignee] → [needs assignee]
Comment 5•17 years ago
|
||
use totalprogress instead of selfprogress?
Comment 6•17 years ago
|
||
(In reply to comment #5)
> use totalprogress instead of selfprogress?
We do use totalprogress for all I can tell. However, the code that could be causing this is this maybe?
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/toolkit/components/downloads/src/nsDownloadManager.cpp&rev=1.153#2061
Assignee | ||
Comment 7•17 years ago
|
||
Strange... can anybody reproduce this? I tried on several pages on windows and mac and they're all reporting a file size now.....
Comment 8•17 years ago
|
||
Hm, but that shouldn't cause 0 bytes reported, right?
Assignee | ||
Comment 9•17 years ago
|
||
(In reply to comment #8)
> Hm, but that shouldn't cause 0 bytes reported, right?
Was there something recently that caused webbrowserpersist files to be saved/created in a different order?
This bug came up probably because in the "STOP" code, we try getting the file size from disk, but that might be 0 because the html file was just created -- another file finished (perhaps an image) and triggered the STOP code.
The reason why I ask if the download order changed is because some reason the file /doesn't/ exist, so it's falling back on the max transfer size (the else case):
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/toolkit/components/downloads/src/nsDownloadManager.cpp&rev=1.156&mark=2105-2107#2087
This fix doesn't completely solve the issue of multiple-file downloads from WBP. It should work for saving pages because those files are transferring from cache.
I still can't reproduce the bug anymore, but this patch will help make sure it doesn't show up as 0.
Assignee | ||
Comment 10•17 years ago
|
||
Whoops. diff didn't pick up .h
Attachment #299469 -
Attachment is obsolete: true
Attachment #299470 -
Flags: review?(sdwilsh)
Attachment #299469 -
Flags: review?(sdwilsh)
Assignee | ||
Comment 11•17 years ago
|
||
This won't work completely if ProgressChange64 never gets called..
Comment 12•17 years ago
|
||
Comment on attachment 299470 [details] [diff] [review]
v1
sure, this should help if something strange happens - but I'm with you that I cannot get it to reproduce :/
r=sdwilsh
Attachment #299470 -
Flags: review?(sdwilsh)
Attachment #299470 -
Flags: review+
Attachment #299470 -
Flags: approval1.9?
Assignee | ||
Comment 13•17 years ago
|
||
Now with more network action!
I haven't tested this yet, but it sounds like it should work according to nsWebBrowserPersist.cpp code. The NETWORK bit is only set if it's totally completed.
I can get this to reproduce if I don't browse to any other pages after opening the app. Open app, cmd-s, save, open DM, 0 bytes.... sometimes.
Checking if 2 flags (out of more than 2 flags) are set..
(flags & FLAG1) && (flags & FLAG2)
or..
flags & (FLAG1 | FLAG2) == (FLAG1 | FLAG2)
or..
!(~flags & (FLAG1 | FLAG2))
Attachment #299470 -
Attachment is obsolete: true
Attachment #299487 -
Flags: review?(sdwilsh)
Attachment #299470 -
Flags: approval1.9?
BTW, https://build.mozilla.org/tryserver-builds/2008-01-26_17:37-edward.lee@engineering.uiuc.edu-dlmgr.0size/ fixed this for me...
Comment 16•17 years ago
|
||
Comment on attachment 299487 [details] [diff] [review]
v1.1
>- } else if ((aStateFlags & STATE_STOP) && IsFinishable()) {
>+ } else if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_NETWORK) &&
>+ IsFinishable()) {
eh, a comment about this please
r=sdwilsh
Attachment #299487 -
Flags: review?(sdwilsh) → review+
Assignee | ||
Comment 17•17 years ago
|
||
If we can trigger a "save page as" dialog and save it with a mochitest... ooh.
Checking in toolkit/components/downloads/src/nsDownloadManager.cpp;
/cvsroot/mozilla/toolkit/components/downloads/src/nsDownloadManager.cpp,v <-- nsDownloadManager.cpp
new revision: 1.157; previous revision: 1.156
done
Checking in toolkit/components/downloads/src/nsDownloadManager.h;
/cvsroot/mozilla/toolkit/components/downloads/src/nsDownloadManager.h,v <-- nsDownloadManager.h
new revision: 1.62; previous revision: 1.61
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Flags: in-litmus?
Resolution: --- → FIXED
Whiteboard: [needs assignee]
Assignee | ||
Comment 18•17 years ago
|
||
As checked in with more comments on the NETWORK stuff.
Thanks for trying out the trybuilds.
Attachment #299487 -
Attachment is obsolete: true
Comment 19•17 years ago
|
||
Looks like this regressed download manager, it always shows as downloading even after download is finished, this is on Linux, latest CVS.
Assignee | ||
Comment 20•17 years ago
|
||
The first part of this fix got webbrowserpersist downloads working. The second part of this fix was landed in bug 414306 for exthandler downloads.
Verified FIXED using:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008012804 Minefield/3.0b3pre
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3pre) Gecko/2008012804 Minefield/3.0b3pre
-and-
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b3pre) Gecko/2008012804 Minefield/3.0b3pre
Status: RESOLVED → VERIFIED
Flags: in-litmus? → in-litmus+
Updated•16 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•