Closed Bug 840078 Opened 7 years ago Closed 7 years ago

onerror callback is never triggered over the DOMRequest returned by mozIDOMApplication.launch

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set

Tracking

(firefox20 wontfix, firefox21 fixed, b2g18+ fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

RESOLVED FIXED
mozilla21
Tracking Status
firefox20 --- wontfix
firefox21 --- fixed
b2g18 + fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix

People

(Reporter: ferjm, Assigned: ferjm)

References

Details

Attachments

(1 file)

While writing tests for Bug 821589 I've noticed that the callbacks for the |DOMRequest| returned by |mozIDOMApplication.launch| [1] are never triggered.

[1] https://mxr.mozilla.org/mozilla-central/source/dom/interfaces/apps/nsIDOMApplicationRegistry.idl#86
Assignee: nobody → ferjmoreno
Doesn't this basically mean that marketplace (or anyone using the API) won't ever know the success or failure of launching of the app then?
tracking-b2g18: --- → ?
Attached patch Fix onerror (v1)Splinter Review
We were missing the "Webapps:Launch:Return:KO" message registration.
Attachment #712459 - Flags: review?(fabrice)
(In reply to Jason Smith [:jsmith] from comment #1)
> Doesn't this basically mean that marketplace (or anyone using the API) won't
> ever know the success or failure of launching of the app then?

I am afraid so.
Comment on attachment 712459 [details] [diff] [review]
Fix onerror (v1)

Review of attachment 712459 [details] [diff] [review]:
-----------------------------------------------------------------

Note that we never send the "OK" one either because for now we have no way to know if the app launched properly.
Attachment #712459 - Flags: review?(fabrice) → review+
After talking with Fabrice via IRC, we agreed to only fix the .onerror callback for now.

<ferjm> fabrice, ping
[09:27]  <fabrice> ferjm: pong
[09:27]  <ferjm> fabrice, Hi! regarding Bug 840078
[09:27]  <firebot> Bug https://bugzilla.mozilla.org/show_bug.cgi?id=840078 nor, --, ---, ferjmoreno, NEW, onsuccess/onerror callbacks are never triggered over the DOMRequest returned by mozIDOMApplication.l
[09:27]  * davehunt|mtg is now known as davehunt
[09:27]  <ferjm> do you think it is ok just to trigger the DOMRequest.onsuccess before notifying observers of webapps-launch https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#913 ?
[09:27]  * glob|mtg is now known as glob
[09:27]  <ferjm> fabrice, or should we wait for a potential mozContentEvent notifying about a successful launch?
[09:27]  * ctalbert|afk is now known as ctalbert
[09:27]  <fabrice> ferjm: there's no good solution. If we fire it right away, that just means that the registry sent a signal to open it. But different platforms have very different implementations, and we have no proper glue to get answers back. That will be part of the spring refactoring. Is this blocking your tests?
[09:27]  <ferjm> fabrice, it would be great to have at least the .onerror callback for the tests
[09:27]  <ferjm> fabrice, I don't care that much about the onsuccess one for the tests
[09:27]  <fabrice> ferjm: your patch does that, no?
[09:27]  <ferjm> yes
[09:27]  <fabrice> so let's go with that for now
[09:27]  * mdas|afk is now known as mdas
[09:27]  <ferjm> ok, cool. Thanks!
Attachment #712459 - Attachment description: Part 1: Fix onerror (v1) → Fix onerror (v1)
Summary: onsuccess/onerror callbacks are never triggered over the DOMRequest returned by mozIDOMApplication.launch → onerror callback is never triggered over the DOMRequest returned by mozIDOMApplication.launch
Blocks: app-install
https://hg.mozilla.org/mozilla-central/rev/292d5dd1c2a0
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Comment on attachment 712459 [details] [diff] [review]
Fix onerror (v1)

[Approval Request Comment]
Bug caused by (feature/regressing bug #): None
User impact if declined: The user won't have feedback and explanations of a failed app launch.
Testing completed: Local testing
Risk to taking this patch (and alternatives if risky): Very low risk
String or UUID changes made by this patch: None
Attachment #712459 - Flags: approval-mozilla-b2g18?
Comment on attachment 712459 [details] [diff] [review]
Fix onerror (v1)

Approving for v1-train uplift, low risk and will improve user communications around app install.
Attachment #712459 - Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18+
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.