Closed Bug 917036 Opened 11 years ago Closed 11 years ago

Notifications: double call to to mozSetMessageHandler listener

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:-)

RESOLVED INVALID
blocking-b2g -

People

(Reporter: jrburke, Assigned: qdot)

Details

(Whiteboard: [systemsfe])

Attachments

(1 file)

Steps to reproduce:

* Set a navigator.mozSetMessageHandler('notification', ...) listener.
* Trigger a `new Notification()` and make sure the app is closed before clicking on the notification.

Expected results:

* The mozSetMessageHandler listener is called once per notification

Actual:

*  The mozSetMessageHandler listener is called twice.

Attaching a sample app that exhibits the behavior. Occurs with latest Gaia master and Gecko moz-central. From git log:

Gaia: c6b4cc05b2de6884a652c1c5ab8401216ffa46c1
Gecko: 78b3dbc50a8cddea792b6c2870c0bfbe3726335c
Sounds like a cut and dry blocker to me.
blocking-b2g: --- → koi?
Whiteboard: [systemsfe]
Gonna guess this is somehow my fault. Taking.
Assignee: nobody → kyle
Ok, so, we are sending it twice, because two events are happening: desktop-notification-click, and desktop-notification-closed. As I'm reading it, you should check the "clicked" property of the system message, which will only be true if the desktop-notification-click event is being sent. Otherwise, don't do anything.

Does this sounds ok?
Flags: needinfo?(jrburke)
Right, sorry for the noise. I keep not expecting that behavior, but I believe that follows from how the notification spec is written. I have added to a thread on dev-gaia to discuss some smaller things like this, but closing this bug as it is working as designed, follows from a reasonable interpretation of the current spec.
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(jrburke)
Resolution: --- → INVALID
No longer blocks: b2g-notifications
blocking-b2g: koi? → ---
blocking-b2g: --- → -
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: