Closed Bug 899353 Opened 12 years ago Closed 11 years ago

Show progress while installing packaged apps or appcache

Categories

(Firefox Graveyard :: Web Apps, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: marco, Assigned: marco)

References

Details

Attachments

(1 file, 7 obsolete files)

We should show something to the user while we're downloading an app, otherwise the user could think something went wrong. We don't have to show a real progress, but at least something that tells the user we're actually doing something. Some options are: 1) A progress popup notification (like we do for addons) 2) A fake progress popup notification (a progress bar that keeps moving and moving until the download is finished). This could be useful because sometimes we don't have correct informations on the download size. 3) Add an entry in the downloads panel (I don't know if it's feasible, may be too difficult).
Another option is not to show the UI in Firefox itself, but leave to the content the opportunity to do that (it's the current situation).
Attached patch show_progress (obsolete) — Splinter Review
I think an undetermined progressmeter could be a good solution while we decide.
Attachment #789944 - Flags: review?(felipc)
Priority: -- → P1
Attached patch show_progress (obsolete) — Splinter Review
(After bug 747552, the WebappsInstaller.install function will return a promise)
Assignee: nobody → mcastelluccio
Attachment #789944 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #789944 - Flags: review?(felipc)
Attachment #792404 - Flags: review?(felipc)
Attached patch Patch (obsolete) — Splinter Review
This is even simpler.
Attachment #792404 - Attachment is obsolete: true
Attachment #792404 - Flags: review?(felipc)
Attachment #793133 - Flags: review?(felipc)
Comment on attachment 793133 [details] [diff] [review] Patch Review of attachment 793133 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/modules/webappsUI.jsm @@ +27,5 @@ > init: function webappsUI_init() { > Services.obs.addObserver(this, "webapps-ask-install", false); > Services.obs.addObserver(this, "webapps-launch", false); > Services.obs.addObserver(this, "webapps-uninstall", false); > + cpmm.addMessageListener("Webapps:OfflineCache", this); nit: remove listener on uninit @@ +37,5 @@ > Services.obs.removeObserver(this, "webapps-uninstall"); > }, > > + receiveMessage: function(aMessage) { > + let msg = aMessage.json; `json` still works but has been deprecated: use -> aMessage.data also the name of this var is better as "data" rather than "msg" @@ +147,5 @@ > + yield WebappsInstaller.install(aData, aManifest); > + if (this.downloads[manifestURL]) { > + yield this.downloads[manifestURL].promise; > + } > + installationSuccessNotification(aData, app, bundle); question: will this notification automatically overwrite the progress notification? @@ +154,4 @@ > // TODO: Notify user that the installation has failed > + } finally { > + notification.remove(); > + if (this.downloads[manifestURL]) { no need for the if check, you can always call delete @@ +194,5 @@ > } > } > }; > > + let notifier; this declaration can be inside the try block
Attachment #793133 - Flags: review?(felipc) → review+
Attached patch Patch (obsolete) — Splinter Review
Carrying r+. (In reply to :Felipe Gomes from comment #5) > @@ +147,5 @@ > > + yield WebappsInstaller.install(aData, aManifest); > > + if (this.downloads[manifestURL]) { > > + yield this.downloads[manifestURL].promise; > > + } > > + installationSuccessNotification(aData, app, bundle); > > question: will this notification automatically overwrite the progress > notification? One is a popup notification, the other is a XUL alert. The popup notification is removed in the finally block. Maybe we could get rid of the XUL alert, I think we should wait UX input about that. I'll open a new bug.
Attachment #793133 - Attachment is obsolete: true
Attachment #794924 - Flags: review+
Keywords: uiwantedcheckin-needed
Backed out because one of the 4 webapps patches landed on your behalf was causing mochitest-other assertions. You really need to start running your patches through Try before requesting checkin. This is far from the first bustage we've had to backout for. https://hg.mozilla.org/integration/fx-team/rev/3a3d9846ceca https://tbpl.mozilla.org/php/getParsedLog.php?id=27007390&tree=Fx-Team
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #8) > You really need to start running yourbpatches through Try before requesting checkin. I did: https://tbpl.mozilla.org/?tree=Try&rev=30a4e8eb935c
Actually I forgot to add this patch to my try push, so this is at fault. The assertion is: ###!!! ASSERTION: Why did this not get handled while processing mRestyleRoots?: '!element->HasFlag(collector->tracker->RootBit()) || (element->GetFlattenedTreeParent() && (!element->GetFlattenedTreeParent()->GetPrimaryFrame()|| element->GetFlattenedTreeParent()->GetPrimaryFrame()->IsLeaf())) || (aData.mChangeHint & nsChangeHint_ReconstructFrame)', file e:/builds/moz2_slave/fx-team-w32-d-0000000000000000/build/layout/base/RestyleTracker.cpp, line 87
Interestingly, it was also causing mochitest-bc orange. Tim Taubert might be able to help if you have questions on that. https://tbpl.mozilla.org/php/getParsedLog.php?id=27012954&tree=Fx-Team
The assertion is caused by the popup notification, if I don't show it, the assertion isn't triggered.
Depends on: 909512
Attached patch Patch (obsolete) — Splinter Review
Could you see why the popup notification is causing the assertion?
Attachment #794924 - Attachment is obsolete: true
Flags: needinfo?(bzbarsky)
Attached patch Patch (obsolete) — Splinter Review
Actually I've fixed the problem by removing the old notification popup before showing the new one.
Attachment #795651 - Attachment is obsolete: true
Flags: needinfo?(bzbarsky)
Nope. This assertion shouldn't happen: that's why it's an assertion. If it's happening, then something is seriously broken somewhere.
(In reply to Boris Zbarsky [:bz] from comment #15) > Nope. This assertion shouldn't happen: that's why it's an assertion. If > it's happening, then something is seriously broken somewhere. I think we can land this patch in the meantime, as the assertion isn't triggered anymore with the fix. Do you agree? Or do you want to fix the underlying problem before?
Landing sounds fine; if you have a reliable way to reproduce the assertion, please file a bug with steps to reproduce!
(In reply to Boris Zbarsky [:bz] from comment #17) > Landing sounds fine; if you have a reliable way to reproduce the assertion, > please file a bug with steps to reproduce! I will! Sadly there's still the unexpected uninterruptible reflow on Linux that prevents landing. ttaubert do you know what causes that?
Flags: needinfo?(ttaubert)
I can reproduce this every time I run browser_duplicateIDs.js before browser_tabopen_reflows.js. If I make browser_duplicateIDs.js a no-op the reflow test is working fine. I'm not sure why but for some reason the querySelector() call or something in that test activates the progress bar and that causes reflows afterwards...
Flags: needinfo?(ttaubert)
Whiteboard: [fixed-in-fx-team]
Strange. This does *not* fail: function test() { document.querySelectorAll("[id]"); } But this does: function test() { Array.forEach(document.querySelectorAll("[id]"), function () {}); }
Replacing Array.forEach() with this still fails: for (let node of document.querySelectorAll("[id]")) {} Is there something special that happens when we access items of a NodeList?
Removing the id attribute from the progressmeter helps, it's unused anyway: - <progressmeter id="webapps-progressmeter" mode="undetermined"/> + <progressmeter mode="undetermined"/> No idea why it doesn't like to be retrieved via querySelectorAll(). While this is a simple workaround I feel like we should investigate the root issue here a little deeper.
> Is there something special that happens when we access items of a NodeList? Yes. XBL bindings would get attached for any of those elements that should have them but don't have them attached yet (e.g. display:none elements).
Okay, that makes sense. Does that mean once the progressmeter has been shown it doesn't stop requesting animation frames until it has been removed from the document? Looks a lot like it: http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/progressmeter.xml#92 Also, the progressmeter should probably not start animating if it is initialized but is hidden?
> Looks a lot like it: Yes, sure does.
So I should probably add the progress meter "on-the-fly" and remove it when I remove the notification.
Attached patch Patch v2 (obsolete) — Splinter Review
Attachment #795656 - Attachment is obsolete: true
Attachment #799762 - Flags: review?(felipc)
Attachment #799762 - Flags: review?(felipc) → review+
Attached patch PatchSplinter Review
Updated commit message.
Attachment #799762 - Attachment is obsolete: true
Attachment #801370 - Flags: review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Depends on: 914857
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: