Closed
Bug 963258
Opened 12 years ago
Closed 12 years ago
Alarm API throws exception when enabled in Firefox
Categories
(Core :: DOM: Device Interfaces, defect)
Core
DOM: Device Interfaces
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(1 file, 1 obsolete file)
|
1.10 KB,
patch
|
airpingu
:
review+
|
Details | Diff | Splinter Review |
In Firefox Mulet (more info in bug 943878), the code from the Alarm API throws over here:
http://mxr.mozilla.org/mozilla-central/source/dom/alarm/AlarmsManager.js#184
Because of `principal.URI` being undefined.
It throws and breaks the webconsole. It throws when the console tries to autocomplete.
It's not really clear why we fetch a the page URI from the principal whereas we have window/document objects. Also I don't know what we do exactly with this pageURL value.
| Assignee | ||
Comment 1•12 years ago
|
||
But I know something! That patch fix this exception and make the console work again on the Mulet!
Attachment #8364614 -
Flags: review?(21)
| Assignee | ||
Updated•12 years ago
|
Blocks: firefox-mulet
Comment 2•12 years ago
|
||
Comment on attachment 8364614 [details] [diff] [review]
Prevent exception in the webconsole in alarm code
Review of attachment 8364614 [details] [diff] [review]:
-----------------------------------------------------------------
Gene is probably a better reviewer :)
Attachment #8364614 -
Flags: review?(21) → review?(clian)
Updated•12 years ago
|
Attachment #8364614 -
Flags: review?(clian) → review?(gene.lian)
Comment 3•12 years ago
|
||
Comment on attachment 8364614 [details] [diff] [review]
Prevent exception in the webconsole in alarm code
Review of attachment 8364614 [details] [diff] [review]:
-----------------------------------------------------------------
Please make sure it's still working on the device and the try server before landing. Thanks! r=gene
Updated•12 years ago
|
Attachment #8364614 -
Flags: review?(gene.lian) → review+
| Assignee | ||
Comment 4•12 years ago
|
||
Using the principal origin was a bad idea as it will be something like:
app://alarm.gaiamobile.org
instead of
app://alarm.gaiamobile.org/index.html
In the particular case of the builtin alarm app, it shouldn't make much difference.
But if an app registers from an html document other than index.html, it may break.
A try run:
https://tbpl.mozilla.org/?tree=Try&rev=7e66e021fe56
Gene, I tried it on my device but I wasn't able to dismiss the
attention screen. If I push Close button, the ring stops but
the alarm screen stays and then I can't kill the alarm app.
But it doesn't seem to be related to my patch?
(I'm testing on last gecko/gaia master, but I may have something wrong in my environmenent...)
Attachment #8364614 -
Attachment is obsolete: true
Attachment #8365982 -
Flags: review?(gene.lian)
Comment 5•12 years ago
|
||
(In reply to Alexandre Poirot (:ochameau) from comment #4)
> Created attachment 8365982 [details] [diff] [review]
> Use window location instead of origin
>
> Using the principal origin was a bad idea as it will be something like:
> app://alarm.gaiamobile.org
> instead of
> app://alarm.gaiamobile.org/index.html
Yeap! We have to make sure it's the app://alarm.gaiamobile.org/index.html. Otherwise, the system message cannot be delivered to the correct page.
>
> In the particular case of the builtin alarm app, it shouldn't make much
> difference.
> But if an app registers from an html document other than index.html, it may
> break.
>
> A try run:
> https://tbpl.mozilla.org/?tree=Try&rev=7e66e021fe56
>
> Gene, I tried it on my device but I wasn't able to dismiss the
> attention screen. If I push Close button, the ring stops but
> the alarm screen stays and then I can't kill the alarm app.
>
> But it doesn't seem to be related to my patch?
Sounds not related to the patch. The page URL only determine which page to deliver the system message to:
_fireSystemMessage: function _fireSystemMessage(aAlarm) {
debug("Fire system message: " + JSON.stringify(aAlarm));
let manifestURI = Services.io.newURI(aAlarm.manifestURL, null, null);
let pageURI = Services.io.newURI(aAlarm.pageURL, null, null);
messenger.sendMessage("alarm", this._publicAlarm(aAlarm),
pageURI, manifestURI);
},
If the attention screen shows up, it means the system message has been delivered and the alarm has been fired.
Have you try to exclude your patch to see if this issue still happens?
>
> (I'm testing on last gecko/gaia master, but I may have something wrong in my
> environmenent...)
I'll wait for you experiment to decide the review, although the patch seems to be working (has to be app://alarm.gaiamobile.org/index.html).
| Assignee | ||
Comment 6•12 years ago
|
||
Yes I tried without my patch and have seen the same breakage with dismiss buttons.
I'll try to find someone with 1.3 to see if I'm the only one facing this issue.
| Assignee | ||
Comment 7•12 years ago
|
||
s/1.3/master/
| Assignee | ||
Comment 8•12 years ago
|
||
It looks like it was another patch in my queue that broke it. It works fine now.
(I'm working on Firefox mulet and have various quite significant patch applied)
Flags: needinfo?(gene.lian)
Comment 9•12 years ago
|
||
Comment on attachment 8365982 [details] [diff] [review]
Use window location instead of origin
Review of attachment 8365982 [details] [diff] [review]:
-----------------------------------------------------------------
Please go ahead to land (supposing this won't break the function on the device). Thank you for all the work! :)
Attachment #8365982 -
Flags: review?(gene.lian) → review+
Updated•12 years ago
|
Flags: needinfo?(gene.lian)
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 10•12 years ago
|
||
Keywords: checkin-needed
Comment 11•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Comment 12•12 years ago
|
||
This one causes the regression at bug 980682.
You need to log in
before you can comment on or make changes to this bug.
Description
•