Closed Bug 910236 Opened 7 years ago Closed 7 years ago

[Downloads.jsm] Downloads panel shows one extra download for the number in "+ X other downloads"

Categories

(Firefox :: Downloads Panel, defect)

x86_64
Windows 7
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 27
Tracking Status
firefox26 + verified
firefox27 --- verified

People

(Reporter: mihaelav, Assigned: Paolo)

References

Details

Attachments

(2 files)

Attached image Screenshot
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0, build id: 20130822030204

"+X other downloads" shows a greater number of downloads (1 extra download).

Steps to reproduce:
1. Launch Firefox
2. Perform 3 downloads of your choice (wait for the downloads to be completed).
3. Navigate to http://www.ubuntu.com/download/desktop/thank-you?release=latest&bits=32&distro=desktop&status=zeroc and accept saving the large download.
4. Open the panel and pause the Ubuntu download.
5. While the download from step 4 is in progress perform 3 more small downloads.
6. Open the panel again.

Expected result: "+ 4 other downloads" is displayed in the downloads panel

Actual result: "+ 5 other downloads" is displayed in the downloads panel

Notes:
1. Not reproducible with the old downloads API
2. Reproducible ever since the new Downloads.jsm was introduced to firefox: Nightly from August 6 (by turning the browser.download.useJSTransfer to true)
Blocks: 907082
This works correctly for me on the latest Nightly. I followed the steps to reproduce, using "Save Page As" for the downloads. Mihaela, are you still able to reproduce the original issue?
(In reply to :Paolo Amadini from comment #1)
> This works correctly for me on the latest Nightly. I followed the steps to
> reproduce, using "Save Page As" for the downloads. Mihaela, are you still
> able to reproduce the original issue?

Mozilla/5.0 (X11; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0) Gecko/20100101 Firefox/26.0
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build ID: 20130911030258

Yes, it still reproduces on my side.
I think I'll test again on a clean profile. Can you post more detailed steps in the meantime? The exact way the downloads are started, and their sources, may be relevant.
(In reply to :Paolo Amadini from comment #3)
> I think I'll test again on a clean profile. Can you post more detailed steps
> in the meantime? The exact way the downloads are started, and their sources,
> may be relevant.

Today I downloaded files mentioned in bug 910731:
- friends' pictures from Facebook
- images results of google search
- a pdf: http://www.education.gov.yk.ca/pdf/pdf-test.pdf
- saved random pages using CTRL+S: google.com, google search results page
- firefox installer from http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/
- ubuntu installer from http://www.ubuntu.com/download/desktop/thank-you?release=lts&bits=32&distro=desktop&status=zeroc
Attached patch The patchSplinter Review
This is an issue with the front-end Dwonloads Panel code, possibly triggered by
a slightly different order of events when the back-end is Downloads.jsm.

If a new view on DownloadsData is registered during the call to an
onDataItemAdded callback on another view, the newly registered view will
receive onDataItemAdded callbacks for all the existing items, including the
one just added, then will receive the last notification again.

This happens for the download summary, activated by a change in the download
list. The patch just changes the view registration to occur at the same time
for both the list and the summary. Having the summary view registered even
when there are less than three downloads should have very little impact on
performance.
Assignee: nobody → paolo.mozmail
Status: NEW → ASSIGNED
Attachment #805349 - Flags: review?(enndeakin)
Attachment #805349 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/mozilla-central/rev/75e80089a651
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Attachment #805349 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/dcbf915db245

Gavin's comment in bug 913110 comment 23 contains a general summary about the reason for tracking Firefox 26.
Keywords: verifyme
Verified as fixed on Aurora 26.0a2 - the correct number of downloads is shown in the Downloads Panel (verified by using the test case from the Description as guidance).

Verified on Ubuntu 13.04, Mac OS X 10.8 and Windows 7:
Mozilla/5.0 (X11; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0) Gecko/20100101 
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build ID: 20131003004003
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

Verified as fixed in latest Aurora 27.0a2 (buildID: 20131105004004).
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.