Closed
Bug 776677
Opened 13 years ago
Closed 9 years ago
Catch errors thrown from Webapps.js and show to user
Categories
(Firefox for Android Graveyard :: Web Apps (PWAs), defect, P2)
Tracking
(firefox16 affected, firefox17 affected, fennec+)
RESOLVED
WONTFIX
People
(Reporter: wesj, Unassigned)
Details
(Whiteboard: [leave open], [blocking-webrtandroid1-])
Attachments
(2 files)
|
4.18 KB,
patch
|
fabrice
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
|
3.72 KB,
patch
|
mfinkle
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Errors like:
http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.js#147
need to be shown to the user.
Updated•13 years ago
|
Priority: -- → P2
Updated•13 years ago
|
OS: All → Android
Hardware: All → ARM
Updated•13 years ago
|
tracking-fennec: --- → ?
status-firefox16:
--- → affected
status-firefox17:
--- → affected
Version: unspecified → Trunk
| Reporter | ||
Comment 2•13 years ago
|
||
So I don't think I can get to these errors as easily as I had hoped. They're dispatched on the request event and then bubble to... nowhere? AFAICT, we have no access to the actual events themselves, so we also can't tell if the store has handled them.
I have a quick patch (testing now) to fix that so that nsIDOMRequestService.fireSuccess/Error will return the event and we can see if defaultPrevented == true? That sound ok Jonas?
How about making fireError/Success return a boolean which indicates if defaultPrevented was called? That matches what EventTarget.dispatchEvent does.
| Reporter | ||
Comment 4•13 years ago
|
||
Fixed the DOMRequest stuff in bug 780718. This catches the preventDefault and if it wasn't called dispatches a notification. I only hooked that up for some of the errors in WebApps.js (related to install errors).
Attachment #649430 -
Flags: review?(fabrice)
| Reporter | ||
Comment 5•13 years ago
|
||
This should catch the errors and show them as a toast. I added three different messages. One generic, one for problems with the app manifest, and one for network problems. Errors are listed here:
https://developer.mozilla.org/en-US/docs/DOM/Apps.install
Attachment #649431 -
Flags: review?(mark.finkle)
Updated•13 years ago
|
Attachment #649430 -
Flags: review?(fabrice) → review+
Comment 6•13 years ago
|
||
Jason, do you have an existing test-case in use for desktop I can try this on once it lands?
Comment 7•13 years ago
|
||
Comment on attachment 649431 [details] [diff] [review]
Patch 2/2 - Show the errors
>diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js
>+ switch(aData) {
nit: add a space
switch (aData)
>+ case("INVALID_MANIFEST"):
nit: I have never seen this case style. Please use:
case "INVALID_MANIFEST":
>+ try {
>+ msg = Strings.browser.GetStringFromName("webapps.installError." + aData);
>+ } catch(ex) {
>+ // There is no message for this error, just show the default one
>+
>+ }
Remove this. There are no strings of the form: webapps.installError." + aData
Your switch statement handles the 3 error strings you added.
r+ with fixes
Attachment #649431 -
Flags: review?(mark.finkle) → review+
| Reporter | ||
Comment 8•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8236b3579bf3
Need to test the fennec part better (obviously).
Whiteboard: [leave open]
| Reporter | ||
Comment 9•13 years ago
|
||
backed out because of b2g failures with the domrequest patch:
https://hg.mozilla.org/integration/mozilla-inbound/rev/621cb0844bf5
| Reporter | ||
Comment 10•13 years ago
|
||
| Reporter | ||
Comment 11•13 years ago
|
||
| Reporter | ||
Comment 12•13 years ago
|
||
Comment on attachment 649430 [details] [diff] [review]
Patch 1/2
[Approval Request Comment]
Bug caused by (feature/regressing bug #): new Webapps stuff
User impact if declined: Markets or pages that install apps but that don't do their own error handling can cause the user to get basically no feedback
Testing completed (on m-c, etc.): landed on inbound 8/8
Risk to taking this patch (and alternatives if risky): Low risk. Webapps.js stuff. the higher risk patches are in bug 780718
String or UUID changes made by this patch: None here. Some in the other patch
Attachment #649430 -
Flags: approval-mozilla-aurora?
| Reporter | ||
Comment 13•13 years ago
|
||
Comment on attachment 649431 [details] [diff] [review]
Patch 2/2 - Show the errors
[Approval Request Comment]
Bug caused by (feature/regressing bug #): new Webapps stuff
User impact if declined: Markets or pages that install apps but that don't do their own error handling can cause the user to get basically no feedback
Testing completed (on m-c, etc.): landed on inbound 8/8
Risk to taking this patch (and alternatives if risky): Low risk. Webapps.js stuff. the higher risk patches are in bug 780718
String or UUID changes made by this patch: Error strings to show to the user
Attachment #649431 -
Flags: approval-mozilla-aurora?
| Reporter | ||
Comment 14•13 years ago
|
||
Test failures. I just pulled the webapps.js part because the rest should be fine.
https://hg.mozilla.org/integration/mozilla-inbound/rev/f4495eb1c973
Comment 15•13 years ago
|
||
Can we do some testing on Nightly before we do the uplift here to Aurora? I'd like to see how this functionality works with typical test cases that would cause errors to populate.
Comment 16•13 years ago
|
||
Flagging qawanted to do some testing of this to find out an opinion on the errors messages sent to the user.
Keywords: qawanted
Comment 17•13 years ago
|
||
Updated•13 years ago
|
tracking-fennec: ? → +
Comment 18•13 years ago
|
||
Nice to have.
Updated•13 years ago
|
Attachment #649430 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #649431 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 19•13 years ago
|
||
Played around with the implementation of this. Generally, with a few spot checks, this works by only throwing up a alert pop-up with the error contents if an uncaught exception is thrown by the content of the site. A caught exception won't thrown the error to the pop-up which makes sense.
However, I'm inclined to believe that this might be unnecessary to have exposed to a user, as a user isn't going to care about a site problem like this directly in the browser. A developer would, but they could check the ADB console or use a remote debugging tool to find this out. I'm currently in favor of backing this patch out, as I'm not sure I see the value of exposing the pop-up for uncaught JS exceptions.
Keywords: qawanted
| Reporter | ||
Comment 20•13 years ago
|
||
Just to clarify, this should show a toast, but the part that will make this work hasn't landed (due to some test failures). If you're seeing an alert its likely coming from somewhere else.
Without this failures result in the user seeing nothing. i.e. they hit an install button. Nothing happens.
Updated•13 years ago
|
Whiteboard: [leave open] → [leave open], [blocking-webrtandroid1-]
Comment 21•12 years ago
|
||
I think we shouldn't show this kind of errors to users, they only matter to developers. Instead we should show errors that happen during the installation.
Comment 23•9 years ago
|
||
Per bug 1235869, we're going to disable the Android web runtime, so we won't fix this bug in it.
(This is part of a bulk resolution of bugs in the Firefox for Android::Web Apps component, from which I attempted to exclude bugs that are not specific to the runtime, but it's possible that I included one accidentally. If so, I'm sorry, and please reopen the bug!)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Updated•5 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
•