Notifications: double call to to mozSetMessageHandler listener

RESOLVED INVALID

Status

Firefox OS
Gaia::System
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: jrburke, Assigned: qdot)

Tracking

unspecified
x86
Mac OS X

Firefox Tracking Flags

(blocking-b2g:-)

Details

(Whiteboard: [systemsfe])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 805649 [details]
profile/webapps/double-notify/application.zip that demonstrates the issue

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.
Blocks: 911002
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)
(Reporter)

Comment 4

4 years ago
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
Last Resolved: 4 years ago
Flags: needinfo?(jrburke)
Resolution: --- → INVALID

Updated

4 years ago
No longer blocks: 911002
blocking-b2g: koi? → ---

Updated

4 years ago
blocking-b2g: --- → -
You need to log in before you can comment on or make changes to this bug.