Closed Bug 1353374 Opened 7 years ago Closed 7 years ago

Download progress bar is not showing on the Taskbar button

Categories

(Firefox :: Downloads Panel, defect)

55 Branch
x86
Windows 10
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 55
Tracking Status
firefox52 --- unaffected
firefox-esr52 --- unaffected
firefox53 --- unaffected
firefox54 --- unaffected
firefox55 --- verified

People

(Reporter: alice0775, Assigned: standard8)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file)

STR:
Download something (e.g http://archive.mozilla.org/pub/firefox/nightly/2017/04/2017-04-04-03-02-04-mozilla-central/firefox-55.0a1.en-US.win32.zip )

AR:
Download progress bar is not showing on the Taskbar button

ER:
Download progress bar should be showing on the Taskbar button

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=922e2f268ab3f18834a38c41fe55b10ed1fc6250&tochange=ba78fb79365f3bcff0575568846fde62f0e0b8a0

Regressed by: Bug 1264206
Flags: needinfo?(paolo.mozmail)
Unfortunately I don't have a Windows environment to look at this at the moment, and there's no errors on the console. My suspicions would be:

https://hg.mozilla.org/integration/mozilla-inbound/rev/ba78fb79365f#l4.64

or maybe 

https://hg.mozilla.org/integration/mozilla-inbound/rev/ba78fb79365f#l5.24

or 

https://hg.mozilla.org/integration/mozilla-inbound/rev/ba78fb79365f#l5.45

Most of the rest of the patch is whitespace changes.
Reverting this change fixes the problem.

@@ -106,17 +104,16 @@ this.DownloadsTaskbar = {
     if (!this._summary) {
       Downloads.getSummary(Downloads.ALL).then(summary => {
         // In case the method is re-entered, we simply ignore redundant
         // invocations of the callback, instead of keeping separate state.
         if (this._summary) {
           return;
         }
         this._summary = summary;
-        return this._summary.addView(this);
       }).then(null, Cu.reportError);
     }
   },



(BTW, Mozilla should not change the codes without automated test!)
Flags: needinfo?(standard8)
it makes sense, the review comment there was to "drop the return part", that should have only removed the "return", not the whole line.
I'll fix this in a bit. Obviously I missed that wasn't addressed correctly.

(In reply to Alice0775 White from comment #2)
> (BTW, Mozilla should not change the codes without automated test!)

Unfortunately when doing large clean-ups like this, it isn't always possible to know what is and isn't tested. There's still a large amount of untested code, and whilst we try to add new tests whenever possible this isn't always practical on the larger refactors/improvements.
Assignee: nobody → standard8
Flags: needinfo?(standard8)
Flags: needinfo?(paolo.mozmail)
(In reply to Marco Bonardo [::mak] from comment #3)
> it makes sense, the review comment there was to "drop the return part", that
> should have only removed the "return", not the whole line.

And the "return" is needed, so the line should just be restored as it was.
Comment on attachment 8854878 [details]
Bug 1353374 - Fix regression where the taskbar button wasn't showing the download progress.

r=me for landing the DownloadsTaskbar.jsm changes, but the rest has to wait until tomorrow at least... thanks for adding the test!
(In reply to :Paolo Amadini from comment #7)
> Comment on attachment 8854878 [details]
> Bug 1353374 - Fix regression where the taskbar button wasn't showing the
> download progress.
> 
> r=me for landing the DownloadsTaskbar.jsm changes, but the rest has to wait
> until tomorrow at least... thanks for adding the test!

I think it can wait a day. For now I've pushed to try as I want to make sure the test is stable.
(In reply to :Paolo Amadini from comment #5)
> And the "return" is needed, so the line should just be restored as it was.

you mean for eslint? the return value doesn't seem to be used. I mean, inverting the previous if would probably avoid both returns and make eslint happy.  Btw, this is really NOT IMPORTANT! I am just asking out of curiosity.
No, it's needed because addView returns a Promise, and we need to return it from the then() handler function in order for it to be chained correctly. If addView fails and the Promise is not returned, this would lead to an unhandled rejection.
ah, right, that makes sense. Thank you.
Comment on attachment 8854878 [details]
Bug 1353374 - Fix regression where the taskbar button wasn't showing the download progress.

https://reviewboard.mozilla.org/r/126826/#review130370

The Downloads API makes mo guarantees that progress methods are called in a certain order, or even called at all. For example, if a download is really fast then we might only notify the final state, and if it is the same as the initial state, we might not send any notification at all to the views. Any test relying on current internal timing or on assumptions based on the current implementation of the API might become intermittent at any time.

Unfortunately, this means that the test has to be rewritten. (It's fine if you don't want to do this now, you can land the fix without the test.)

This should be written using the model of the xpcshell tests that check progress reporting in the "jsdownloads" folder:

- Register an interruptible HTTP response handler
- Start the download
  - No need to use the drag-and-drop code to do this, by the way
- Wait until the midway notification of progress
  - Don't use waitForCondition, but have the mocked function resolve a Promise when called with the right conditions
  - This is guaranteed to happen because the response will not continue past this midway point
- Unblock the response so the download can finish
- Wait until both of these happen:
  - The final notification of progress
  - The download has completed
- Clean up

As usual, you have to set up the listeners before triggering the event that will cause them to be invoked.

This likely means porting some of the support functions from "jsdownloads" to here. You may also consider moving the test set-up helper functions to a test-only "DownloadsTestUtils.jsm" in the "jsdownloads" folder, that can easily be referenced from here.
Attachment #8854878 - Flags: review?(paolo.mozmail) → review-
Blocks: 1355024
Ok, thank you for the comments. Given my current workloads, I've split this out into bug 1353374, and I'll get the regression fix landed.
Comment on attachment 8854878 [details]
Bug 1353374 - Fix regression where the taskbar button wasn't showing the download progress.

https://reviewboard.mozilla.org/r/126826/#review130852
Attachment #8854878 - Flags: review+
Attachment #8854878 - Flags: review?(paolo.mozmail)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6bad5caedbb0
Fix regression where the taskbar button wasn't showing the download progress. r=mak
https://hg.mozilla.org/mozilla-central/rev/6bad5caedbb0
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
I have reproduced this bug with Firefox Nightly 55.0a1 (Build ID: 20170404030204) on 
Windows 10, 64-bit.

Verified as fixed with Latest Firefox Nightly 55.0a1 (Build ID: 20170421030241)
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
QA Whiteboard: [bugday-20170419]
Flags: qe-verify+
I reproduced this issue using Fx55.0a1, build ID: 20170404030204, on Windows 10 x64.
I can confirm this issue is fixed, I verified using Fx55.0b3, on Windows 10 x64.

Cheers!
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: