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)
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.
Reporter | ||
Comment 1•11 years ago
|
||
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.
Reporter | ||
Comment 2•11 years ago
|
||
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
Reporter | ||
Comment 3•11 years ago
|
||
apps/email/js/sync.js:
- getting icon URI
Reporter | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 4•11 years ago
|
||
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 → ---
Reporter | ||
Comment 5•11 years ago
|
||
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)
Comment 6•11 years ago
|
||
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)
Updated•11 years ago
|
blocking-b2g: --- → backlog
Whiteboard: [systemsfe]
Reporter | ||
Comment 7•10 years ago
|
||
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 → ---
Comment 8•10 years ago
|
||
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)
Reporter | ||
Comment 9•10 years ago
|
||
(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 ago → 10 years ago
Flags: needinfo?(lissyx+mozillians)
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•