Closed
Bug 802876
Opened 12 years ago
Closed 12 years ago
navigator.mozHasPendingMessage('alarm') has stopped working
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jmcf, Assigned: airpingu)
References
Details
Attachments
(1 file)
20.58 KB,
application/zip
|
Details |
Using Gecko build 1ec4bde
navigator.mozHasPendingMessageAlarm is returning false when an alarm is delivered. See the attached test case
Comment 1•12 years ago
|
||
can you provide a regression window?
Updated•12 years ago
|
Assignee: nobody → clian
Assignee | ||
Comment 2•12 years ago
|
||
Hi Jose,
At my first glance, I think you probably misunderstand the usage of .mozHasPendingMessage(). We only have pending alarm messages when the alarm message is fired but the app is not yet opened to handle that.
In your example, you can directly call .mozSetMessageHandler() without checking the pending messages first. You won't get any pending messages at this point because the alarm is going to fire after 1 min.
Reporter | ||
Comment 3•12 years ago
|
||
(In reply to Gene Lian [:gene] from comment #2)
> Hi Jose,
>
> At my first glance, I think you probably misunderstand the usage of
> .mozHasPendingMessage(). We only have pending alarm messages when the alarm
> message is fired but the app is not yet opened to handle that.
>
If the app is not yet opened the app cannot do anything. mozHasPendingMessage should return true if an alarm has been raised and it has not been acknowledged yet by the app. Furthermore, the point is that it was working three or four builds ago and now is not working.
> In your example, you can directly call .mozSetMessageHandler() without
> checking the pending messages first. You won't get any pending messages at
> this point because the alarm is going to fire after 1 min.
You have misunderstood my example. There are some use cases on which you need to know if a page has been invoked because an alarm has been gone off or for other reason. The one minute timeout is only an example. What it is actually failing is that when the alarm has been raised navigator.mozHasPendingMessage('alarm') is returning false.
Comment 4•12 years ago
|
||
I think some STR would be great.
I assume you open the app, create the alarm by clicking on the button, kill the app and wait for the alarm to open the app again. But I'm only assuming...
Component: General → DOM: Mozilla Extensions
Keywords: regressionwindow-wanted
Product: Boot2Gecko → Core
Target Milestone: DeveloperPhone → ---
Assignee | ||
Comment 5•12 years ago
|
||
I just used the Clock app to try to reproduce this bug by calling .mozHasPendingMessage() as below:
var temp = navigator.mozHasPendingMessage('alarm');
console.log("gene test: " + temp);
navigator.mozSetMessageHandler('alarm', function gotMessage(message) {
self.onAlarmFiredHandler(message);
});
Obviously, the first print must be "false" when opening the Clock app at the first time. Later, I set an alarm and kill the app. When the alarm goes off, the second print shows "true" which is expected. It seems .mozHasPendingMessage() works well for me.
Updated•12 years ago
|
Flags: needinfo?(jmcf)
Is this related to bug 796255?
Assignee | ||
Comment 7•12 years ago
|
||
(In reply to Naoki Hirata :nhirata from comment #6)
> Is this related to bug 796255?
Thanks for pointing this out, but I don't think they would have relations. The Clock app didn't use .mozHasPendingMessage() at all.
Reporter | ||
Comment 8•12 years ago
|
||
thanks for all your comments.
Today I have tried with Gecko build 43b9264 and initially started working. After some executions it stopped working and then after a make reset-gaia and a phone reboot it resumed working.Thus, it seems there is something wrong that makes it to work randomly. I checked over the Gaia code and realized that the only apps that make use of mozHasPendingMessage('alarm') are e-mail and the Facebook deep integration, thus there might be a bug as maybe that functionality has not been intensively tested till now.
Flags: needinfo?(jmcf)
Comment 9•12 years ago
|
||
(In reply to Jose M. Cantera from comment #8)
> I checked over the Gaia code and
> realized that the only apps that make use of mozHasPendingMessage('alarm')
> are e-mail and the Facebook deep integration, thus there might be a bug as
> maybe that functionality has not been intensively tested till now.
The clock app doesn't use it?
Assignee | ||
Comment 10•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #9)
> The clock app doesn't use it?
No, it doesn't. Maybe Ian can elaborate more on why it is.
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Jose M. Cantera from comment #8)
> Today I have tried with Gecko build 43b9264 and initially started working.
> After some executions it stopped working and then after a make reset-gaia
> and a phone reboot it resumed working.Thus, it seems there is something
> wrong that makes it to work randomly. I checked over the Gaia code and
> realized that the only apps that make use of mozHasPendingMessage('alarm')
> are e-mail and the Facebook deep integration, thus there might be a bug as
> maybe that functionality has not been intensively tested till now.
Thanks Jose for the testings. Well, I have no idea how to further investigate this issue if we couldn't reproduce that. At least, it works for me so far. ;)
Fabrice, any quick thoughts about the random effect at comment 8?
Comment 12•12 years ago
|
||
Based on comment #8 which seems to indicate things are now working (perhaps randomly?), not blocking.
blocking-basecamp: ? → -
Assignee | ||
Comment 13•12 years ago
|
||
Temporally remove the tags for blocking and keep track of this issue.
Severity: blocker → normal
Priority: P1 → --
Assignee | ||
Comment 14•12 years ago
|
||
Let's close this one where the bug cannot be reproduced and the .mozHasPendingMessage("alarm") is actually working. Please let me know if we need to reopen this issue.
Assignee | ||
Updated•12 years ago
|
Updated•12 years ago
|
Component: DOM: Mozilla Extensions → DOM
Updated•9 years ago
|
Keywords: regressionwindow-wanted
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•