Closed
Bug 1113092
Opened 10 years ago
Closed 10 years ago
Android download notifications are displayed every time Firefox is opened
Categories
(Firefox for Android Graveyard :: Download Manager, defect)
Tracking
(firefox34 unaffected, firefox35 unaffected, firefox36 unaffected, firefox37 verified, fennec37+)
VERIFIED
FIXED
Firefox 37
Tracking | Status | |
---|---|---|
firefox34 | --- | unaffected |
firefox35 | --- | unaffected |
firefox36 | --- | unaffected |
firefox37 | --- | verified |
fennec | 37+ | --- |
People
(Reporter: u421692, Assigned: Margaret)
References
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
Build: Nightly 37.0a1 (2014-12-18)
Steps to reproduce:
1. Open Firefox
2. Download some files (e.g. ftp://ftp.mozilla.org/pub/mobile/)
3. Close Firefox
4. Open Firefox
Expected result:
Firefox is opened
Actual result:
Firefox is opened, and the download toast notification is displayed, and android download notifications are displayed again for the files downloaded in the last session.
I've checked, and the files are not downloaded, only the notifications are displayed.
Assignee | ||
Comment 4•10 years ago
|
||
This may be a dupe of bug 1111659.
Updated•10 years ago
|
Assignee: nobody → margaret.leibovic
tracking-fennec: ? → 37+
Comment 5•10 years ago
|
||
Obvious workaround, if you're happy losing the file: delete it from Tools > Downloads.
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8540283 -
Flags: review?(paolo.mozmail)
Assignee | ||
Comment 8•10 years ago
|
||
/r/1637 - Bug 1113092 - Don't create new download notifications for succeeded downloads
Pull down this commit:
hg pull review -r 4238be0e7aa7ca5e38da9a0b9b1b2f1bf9ac40fb
Assignee | ||
Comment 9•10 years ago
|
||
I found that we still showed the "Download started..." toast notifications if the download was canceled, so I added a check to avoid that.
I looked through the comments in bug 901360 to try to remember what was wrong with this approach, but I'm having trouble understanding how to update it to deal with the potential race issue of a new download succeeding before onDownloadAdded is called.
Paolo, do you have an example of how this could happen? I tried reproducing with very small downloads on a fast wifi network, but I didn't see any problems.
Comment 10•10 years ago
|
||
It happened to me with a download that I had successfully completed the previous day.
* Download a PDF.
* View it.
* Go on with my life (probably including using the browser!).
* Overnight, browser likely evicted from memory.
* Open a link in the morning. Notification appears.
So STR are likely to be:
* Complete a download.
* Kill the package with `am`.
* Relaunch the activity.
Assignee | ||
Comment 11•10 years ago
|
||
Sorry if I wasn't clear, the thing I couldn't reproduce is a notification *not* being added for a succeeded download with this patch applied. I was speaking about an issue raised in bug 901360 comment 65.
The bug as described here is indeed very easy to reproduce by killing Fennec.
Comment 12•10 years ago
|
||
Comment on attachment 8540283 [details]
MozReview Request: bz://1113092/margaret
(In reply to :Margaret Leibovic from comment #9)
> Paolo, do you have an example of how this could happen? I tried reproducing
> with very small downloads on a fast wifi network, but I didn't see any
> problems.
It might not be reproducible with the current code. We have enough promise resolution cycles in the saver, so that "succeeded" is always set after the add notification. PDF saving code may have less cycles, but they're probably still enough.
But have you tried setting a boolean flag after list.addView(this) resolves? Maybe you can reuse _viewAdded, note how you can call removeView unconditionally in "uninit" because calling it twice does not cause an error. You may need a separate boolean for other synchronous initialization, though.
You can then try and check it in addition to the "succeeded" call, like I suggested in bug 901360 comment 72.
Also, the currentBytes check does not seem robust to me - the toast should probably be shown for new downloads when the boolean flag is set, that means never during startup.
Attachment #8540283 -
Flags: review?(paolo.mozmail)
Assignee | ||
Comment 13•10 years ago
|
||
(In reply to :Paolo Amadini from comment #12)
> Comment on attachment 8540283 [details]
> MozReview Request: bz://1113092/margaret
>
> (In reply to :Margaret Leibovic from comment #9)
> > Paolo, do you have an example of how this could happen? I tried reproducing
> > with very small downloads on a fast wifi network, but I didn't see any
> > problems.
>
> It might not be reproducible with the current code. We have enough promise
> resolution cycles in the saver, so that "succeeded" is always set after the
> add notification. PDF saving code may have less cycles, but they're probably
> still enough.
>
> But have you tried setting a boolean flag after list.addView(this) resolves?
> Maybe you can reuse _viewAdded, note how you can call removeView
> unconditionally in "uninit" because calling it twice does not cause an
> error. You may need a separate boolean for other synchronous initialization,
> though.
>
> You can then try and check it in addition to the "succeeded" call, like I
> suggested in bug 901360 comment 72.
I tried using the current this._viewAdded boolean flag, and it wasn't working as expected, but I now realize that's because that we don't wait for the promise to resolve before setting that to true. I don't know why we even need the flag the way it's currently used, since we only call init() once during startup.
I'll try setting a boolean flag when the promise resolves as you suggest, and hopefully that will solve my issue.
> Also, the currentBytes check does not seem robust to me - the toast should
> probably be shown for new downloads when the boolean flag is set, that means
> never during startup.
Yeah, I agree. I can do more to fix that.
Assignee | ||
Comment 14•10 years ago
|
||
Also, we never call DownloadNotifications.uninit, so we can just get rid of that. (On Android we decided to just get rid of shutdown handlers, since the majority of the time "shutdown" happens when we are killed by the OS, so we don't have time to call these handlers).
Assignee | ||
Updated•10 years ago
|
Attachment #8540283 -
Flags: review?(paolo.mozmail)
Attachment #8540283 -
Flags: review?(mark.finkle)
Assignee | ||
Comment 15•10 years ago
|
||
/r/1637 - Bug 1113092 - Don't create new download notifications for succeeded downloads
Pull down this commit:
hg pull review -r 8f0338f5d3495259b77b1fbcea48497a9f59e025
Assignee | ||
Comment 16•10 years ago
|
||
I tested this new patch by killing and restarting the app with succeeded/paused/canceled downloads. Everything works as expected.
Updated•10 years ago
|
Attachment #8540283 -
Flags: review?(mark.finkle) → review+
Comment 17•10 years ago
|
||
Updated•10 years ago
|
Attachment #8540283 -
Flags: review?(paolo.mozmail) → review+
Comment 18•10 years ago
|
||
Assignee | ||
Comment 19•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Reporter | ||
Comment 21•10 years ago
|
||
Verified as fixed on latest Nightly on Nexus 7(Android 5.0.1)
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 22•9 years ago
|
||
Attachment #8540283 -
Attachment is obsolete: true
Attachment #8618935 -
Flags: review+
Assignee | ||
Comment 23•9 years ago
|
||
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•