Closed Bug 701722 Opened 13 years ago Closed 13 years ago

Multiple cancel prompts generated by tapping in-progress downloads several times

Categories

(Firefox for Android Graveyard :: General, defect, P3)

ARM
Android
defect

Tracking

(firefox11 fixed, fennec11+)

VERIFIED FIXED
Tracking Status
firefox11 --- fixed
fennec 11+ ---

People

(Reporter: davehunt, Assigned: Margaret)

References

Details

(Whiteboard: [testday-20111111])

Attachments

(1 file)

It's possible to tap the in-progress download multiple times by ignoring the cancel prompt. This causes multiple prompts to build up. If you never choose to cancel the download then after the download is complete and you return to Fennec you then must dismiss all accumulated prompts. If you do choose to cancel the download then the download is cancelled and the file is not opened, but you still need to dismiss all of the prompts.

Steps to reproduce:
1. Start a download for a large file (to give you time to complete these steps)
2. Bring up the Android download manager
3. Tap the in-progress download
4. Ignore the cancel prompt, and bring up the Android download manager
5. Tap the in-progress download
6. Repeat 4 & 5 as many times as you wish

Expected:
Subsequently tapping the in-progress download should focus the existing cancel prompt.

Actual:
New cancel prompts pop up on top of the existing ones. This means all must be dismissed before you can return to Fennec.
Whiteboard: [testday-20111111]
Assignee: nobody → margaret.leibovic
Attached patch patchSplinter Review
I'm somewhat confused as to how we can re-enter that JS code if it's blocked on confirmEx. This feels kind of hacky, but it fixes the problem. I'm curious if you have ideas for a better solution.
Attachment #573949 - Flags: review?(mark.finkle)
Also, if the download finishes while the prompt is showing, the prompt becomes useless. Is there a way to dismiss it once the download finishes? Maybe we can file another bug about that.
Priority: -- → P3
Priority: P3 → --
I betting Gavin didn't want to change the priority
Priority: -- → P3
Comment on attachment 573949 [details] [diff] [review]
patch

  showAlert: function dl_showAlert(aDownload, aMessage, aTitle, aIcon) { 
>     let self = this;
>+    // Use this flag to make sure we only show one prompt at a time

Add a blank line before the comment

>+    let cancelPromptShowing = false;

"cancelPrompt" is enough IMO


This patch does fix the problem, but as you suggest, it's a bit hacky. You mention that we need a way to dismiss a prompt. If we had that API, I would suggest using it to cancel an existing prompt. That way we could cancel prompts when a new prompt is needed (this bug) and cancel the prompt if the download finishes (a different bug).

It would seem a bit cleaner that way.

r+ though since this addresses the immediate issue.

File a new bug on adding a way to dismiss prompts, and we can use it to fix this bug a little better too.
Attachment #573949 - Flags: review?(mark.finkle) → review+
Depends on: 702693
(In reply to Mark Finkle (:mfinkle) from comment #4)
> File a new bug on adding a way to dismiss prompts, and we can use it to fix
> this bug a little better too.

Filed bug 702693.
https://hg.mozilla.org/projects/birch/rev/f5c60c4ec1ed
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Verified fix on:
Mozilla/5.0 (Android;Linux armv7l;rv:11.0a1)Gecko/20111117 Firefox/11.0a1 Fennec/11.0a1
Status: RESOLVED → VERIFIED
tracking-fennec: --- → 11+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: