Closed Bug 948334 Opened 11 years ago Closed 10 years ago

Convert Email to new Notification API

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gerard-majax, Unassigned)

References

Details

(Whiteboard: [systemsfe])

While investigating the email app in context of bug 938541, I came accross this: $ grep -R 'NotificationHelper' apps/email/ apps/email/shared/test/unit/mocks/mock_notification_helper.js:var MockNotificationHelper = { apps/email/shared/js/notification_helper.js:var NotificationHelper = { apps/email/test/config.js: exports: 'NotificationHelper' apps/email/js/mail_app.js: exports: 'NotificationHelper' $ It seems that NotificationHelper has been used in the past, but now the app is using the Notification API, not mozNotification anymore. So we have a useless reference to this helper: https://github.com/mozilla-b2g/gaia/commit/93e3fa9b7907429fe1dbcef513526a192bf6bfeb removes the usage of NotificationHelper. This commit also contains a buggy/stale reference to navigator.mozNotification, which should be replaced by window.mozNotification.
Blocks: 938541
Looks like I've been a bit too quick. There is an obvious usage of NotificationHelper at https://github.com/mozilla-b2g/gaia/blob/master/apps/email/js/sync.js#L9.
So we want to make use of the new API for this part in fact :)
Summary: [Gaia][Email] Stale reference to NotificationHelper → Convert Email to new Notification API
apps/email/js/sync.js: - getting icon URI
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Again, too fast. apps/email/js/sync.js: - getting icon URI - encoding object as string parameter of the icon (message_list, account id)
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
I think email might be semi broken right now, with the landing of bug 890440: we do not remove automatically notifications sent via the new API. But I suspect email was relying on this and not closing its notifications.
Flags: needinfo?(jrburke)
Flags: needinfo?(bugmail)
Indeed, email does not clear notifications on its own, because it was relying on the old behavior. However, that will change when bug 915643 and bug 922722 land (they should land together). However bug 930794 blocks those changes from landing, so it would be good to have bug 930794 fixed for us to close out the loop. I have asked in that bug if we can get that in place for 1.4.
Flags: needinfo?(jrburke)
Flags: needinfo?(bugmail)
blocking-b2g: --- → backlog
Whiteboard: [systemsfe]
Someone from Email should do the migration. This is pretty simple, and there are already examples of it in Gaia.
Assignee: lissyx+mozillians → nobody
blocking-b2g: backlog → ---
Email just uses notification_helper for the getIconURI function, but uses `new Notification()` to create new notifications. If there is a suggested replacement for the getIconURI function, I can switch to that. Otherwise, I do not think there is anything more to do in the email app for this and we could close this bug.
Flags: needinfo?(lissyx+mozillians)
(In reply to James Burke [:jrburke] from comment #8) > Email just uses notification_helper for the getIconURI function, but uses > `new Notification()` to create new notifications. If there is a suggested > replacement for the getIconURI function, I can switch to that. Otherwise, I > do not think there is anything more to do in the email app for this and we > could close this bug. Thanks, I was doing some cleanup in my bugs, so I think we can close this one then :)
Status: REOPENED → RESOLVED
Closed: 11 years ago10 years ago
Flags: needinfo?(lissyx+mozillians)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.