Closed Bug 966481 Opened 11 years ago Closed 7 years ago

[notifications] object passed to navigator.mozSetMessageHandler('notification') does not have .close

Categories

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

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jrburke, Unassigned)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file)

If a notification is passed to an app vi navigator.mozSetMessageHandler('notification'), the notification message does not a .close method. The attached .zip file is a sample project that demonstrates the issue. This affects the email app, since the changes with bug 890440, apps using the new notification API are expected to manage their own notifications. However, if the app has closed since sending the notification, the common scenario for email background sync, when the user clicks on the notification to start the app, and the email app receives the notification trigger via navigator.mozSetMessageHandler('notification'), that notification cannot be closed through that pathway. This is only a 1.4 or later issue, does not affect 1.3.
Yeah, unfortunately the system message that gets passed to the notification handler only contains a copy of the data from the notification, and does not contain a notification object itself. For now, the workaround is to call Notification.get(), and close the notification returned from there. However, it sounds like a nice feature to have a close function on the system message. Other handlers for mozSetMessageHandler contain the actual object in question (like SMS for instance), but unfortunately passing an actual notification object would require much more work than just exposing '.close'.
Michael> that would mean basically calling "get" behind the scene? Is it really something that difficult? (besides the fact that the whole "get" implementation needs to be redone from scratch ;) )
(In reply to Julien Wajsberg [:julienw] from comment #2) > Michael> that would mean basically calling "get" behind the scene? Is it > really something that difficult? (besides the fact that the whole "get" > implementation needs to be redone from scratch ;) ) Unless I'm mistaken, the system message originates in the parent, and so calling Notification.get() from there will not yield the app's notification until we fix bug 874364 (which will give us a special API for fetching notifications across origins/apps).
Then maybe we can depend on bug 874364 here ?
Depends on: 874364
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: