Closed Bug 393821 Opened 17 years ago Closed 17 years ago

Quick downloads (cached, local, data:, failed) don't appear until you reopen Download Manager

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9beta1

People

(Reporter: stephend, Assigned: Mardak)

References

Details

(Keywords: regression, relnote)

Attachments

(2 files, 3 obsolete files)

Build ID: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a8pre) Gecko/2007082618 Minefield/3.0a8pre, and I saw this on Fedora Core 7, as well.

Noticed this while testing the fix for bug 393556.

Summary: "Failed" downloads don't appear until you reopen Download Manager.

Steps to Reproduce:

1. Right-click on the following: http://www.domain.fake/not_existent_document.pdf
2. Wait for the download to fail; acknowledge the warning
3. Look at the Download Manager.

Actual Results: 

The failed file's entry isn't populated until you close and reopen the DM window; oddly enough, successive files (if you repeat the steps) seem to populate their entries correctly.  The "Active" section
appears, but with no entries.

Expected Results:

The failed downloads named "not_existent_document.pdf" should immediately appear after confirming the failure-alert dialog in the "Completed" section as "Failed" status.
Strange.. I can't reproduce this in a debug build with disable-optimize.

Is there any issue of js not handling events quick enough? I.e., the QUEUED DownloadState event change is sent up to the listener and the FAILED event follows right after it. So both events are waiting to be processed by onDownloadStateChange and it grabs the failed first then queued?

Also, there's possibly some strangeness going on if the download manager isn't initially opened..
I can reproduce it for successful downloads as well. Steps to reproduce:

1. Find a relatively small file which is NOT in your cache.
2. Click on it (I haven't tried right-clicking with save-as).
3. When on open/save dialog, wait a bit. The file will download in background and you must wait until it finishes.
4. Finally, pick either save or open (doesn't matter which)

Expected results: DL manager will open and will show the file.
Actual results: it won't open. If it is open, it will not show the file.

Opening it later on shows the file.

Perhaps this helps.
ah crap, this could be a situation where the download finished in exthandler before we even know about it :/
It's not going through exthandler. I'm alt-clicking the link to download which does saveURI -> wbp.
(In reply to comment #4)
> ah crap, this could be a situation where the download finished in exthandler
> before we even know about it :/
Filed bug 394536.
Attached patch v1 (obsolete) — Splinter Review
I wasn't writing this patch in particular for this bug.. but it seems like it's fixed with the tryserver build. (I couldn't test it with my debug builds as mentioned before.)

https://build.mozilla.org/tryserver-builds/77-elee@mozilla.com-firefox-try-mac.dmg
https://build.mozilla.org/tryserver-builds/78-elee@mozilla.com-firefox-try-linux.tar.bz2

It also has patches for bug 385734, bug 394548, bug 394263, bug 394615, bug
394516, bug 394798, bug 223895, bug 393821

So it might have been one of those changes as well.. but code-wise, it seems like the patch works for this bug. Additionally I don't see bug 394536 with the trybuild either.

Patch notes: We should be correctly createDownloadItem-ing now... so no "d'oh" situations, and therefore remove that code from DPL.js
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #279539 - Flags: review?(comrade693+bmo)
hmm, I need to think about this a bit
Comment on attachment 279539 [details] [diff] [review]
v1

Not quite so it seems. The createDownloads are needed if the dlmgr is already open. We can continue to remove the check here but we'll need to have something tell dlmgr to refresh its list when a download starts.
Attachment #279539 - Flags: review?(comrade693+bmo) → review-
Attached patch v2 (obsolete) — Splinter Review
Call buildActiveList instead of calling its own createDownloadItem. This unifies the item creation, so debugging future issues is easier with just a single code path to think about. Also, put state in a variable to avoid multiple XPC overheads..

Apply some magic and trust everything is working as expected so that we'll never not have a downloadItem from DownloadProgressListener! (other than initial state to queued)
Attachment #279539 - Attachment is obsolete: true
Attachment #279553 - Flags: review?(comrade693+bmo)
Needs bug 394546's patch, otherwise there'll be a ghost item when retrying a download.
Depends on: 394546
Don't checkin before bug 394263 either.
Depends on: 394263
Blocks: 392766
Bug 394615 lets these failed downloads actually STOP and trigger the completed.
Depends on: 394615
Blocks: 394675
Blocks: 394536
Blocks: 394499
Blocks: 393099
Blocks: 393895
For all things blocked by this bug, you can try a buildbot build that should have the problems fixed.

mac: https://build.mozilla.org/tryserver-builds/79-elee@mozilla.com-firefox-try-mac.dmg
linux: https://build.mozilla.org/tryserver-builds/80-elee@mozilla.com-firefox-try-linux.tar.bz2

sorry no windows..
Blocks: 394646
Yayy, windows build bot is back alive. :)

win: https://build.mozilla.org/tryserver-builds/80-elee@mozilla.com-firefox-try-win32.installer.exe
mac: https://build.mozilla.org/tryserver-builds/80-elee@mozilla.com-firefox-try-mac.dmg
lin: https://build.mozilla.org/tryserver-builds/81-elee@mozilla.com-firefox-try-linux.tar.bz2

I've tested the blocked bugs on mac and windows, and things seem to be working again. You can try one of these builds to see if it fixes your bug or wait for this bug to land for nightlies.
Keywords: regression
Summary: "Failed" downloads don't appear until you reopen Download Manager. → Quick downloads (cached, local, data:, failed) don't appear until you reopen Download Manager
Comment on attachment 279553 [details] [diff] [review]
v2

r=sdwilsh
Attachment #279553 - Flags: review?(comrade693+bmo) → review+
Target Milestone: --- → Firefox 3 M9
Attached patch v2.1 (obsolete) — Splinter Review
unbitrot spacing changes from bug 394263
Attachment #279553 - Attachment is obsolete: true
Comment on attachment 280441 [details] [diff] [review]
v2.1

r=sdwilsh
Attachment #280441 - Flags: review+
Attachment #280441 - Flags: approval1.9?
Keywords: relnote
Attachment #280441 - Flags: approval1.9? → approval1.9+
Mardak, are you going to check this in?
This bug isn't ready for checkin because it still has an unresolved dependency.
Blocks: 398197
No longer blocks: 398197
Checking in toolkit/mozapps/downloads/content/DownloadProgressListener.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/content/DownloadProgressListener.js,v  <--  DownloadProgressListener.js
new revision: 1.27; previous revision: 1.26
done
Checking in toolkit/mozapps/downloads/content/downloads.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/content/downloads.js,v  <--  downloads.js
new revision: 1.92; previous revision: 1.91
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Attached patch as checked inSplinter Review
Attachment #280441 - Attachment is obsolete: true
Verified FIXED using

Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a9pre) Gecko/2007100120 Minefield/3.0a9pre

Haven't seen this happen for cached, local, data:, or failed (testcase in comment 0) testcases.
Status: RESOLVED → VERIFIED
Flags: in-litmus?
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: