Closed Bug 900279 Opened 11 years ago Closed 11 years ago

Fix up Gaia notifications implementation in bug 782211 for notification API spec

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jsmith, Assigned: julienw)

References

Details

Attachments

(1 file, 1 obsolete file)

The rebased implementation for gaia notifications in bug 782211 doesn't work on gaia master. We need to fix up the implementation to be able to land it to have notification API spec integration in Gaia.
Blocks: 782211
Attached patch patch v1 (obsolete) — Splinter Review
this is the patch that originally landed in bug 782211
Blocks: 855165
Attached patch patch v2Splinter Review
This patch works for me. Actually the Chrome Event for showing the notification has not changed.

I also added 2 tests for this change.

William, would you please review this change ?

There is a pull request at https://github.com/mozilla-b2g/gaia/pull/11298 (to run Travis) if you prefer.
Attachment #784274 - Attachment is obsolete: true
Attachment #784376 - Flags: review?(wchen)
Assignee: nobody → felash
cc mike so that he knows about this
Comment on attachment 784376 [details] [diff] [review]
patch v2

Etienne, if you feel like reviewing this (again) when you come back ;)
Attachment #784376 - Flags: review?(etienne)
Blocks: 892528
Comment on attachment 784376 [details] [diff] [review]
patch v2

Review of attachment 784376 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the weird code in |clearLockScreen| removed.

If it's not a mistake then we probably need to talk :)

::: apps/system/js/notifications.js
@@ +403,5 @@
> +    event.initCustomEvent('mozContentEvent', true, true, {
> +      type: 'desktop-notification-close',
> +      id: notificationNode.dataset.notificationId
> +    });
> +    window.dispatchEvent(event);

Not sure why we have this here?
Is this a copy and paste mistake? What's notificationNode?
Attachment #784376 - Flags: review?(etienne) → review+
Comment on attachment 784376 [details] [diff] [review]
patch v2

Review of attachment 784376 [details] [diff] [review]:
-----------------------------------------------------------------

::: apps/system/js/notifications.js
@@ +403,5 @@
> +    event.initCustomEvent('mozContentEvent', true, true, {
> +      type: 'desktop-notification-close',
> +      id: notificationNode.dataset.notificationId
> +    });
> +    window.dispatchEvent(event);

mmm right, it probably was in the first patch and I haven't changed anything here. Maybe notificationNode was existing in the 6-month-old code.

I don't exactly know what "clearLockScreen" is supposed to do. Is it only clearing the notifications displayed in the lockscreen, but they still are in the notification screen ?
Comment on attachment 784376 [details] [diff] [review]
patch v2

Review of attachment 784376 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for the delay. I haven't looked at this Gaia code in a while.

::: apps/system/js/notifications.js
@@ +403,5 @@
> +    event.initCustomEvent('mozContentEvent', true, true, {
> +      type: 'desktop-notification-close',
> +      id: notificationNode.dataset.notificationId
> +    });
> +    window.dispatchEvent(event);

This looks like a mistake in the original patch. It shouldn't be sending the close event unless the notification is being removed from the notification screen.
Attachment #784376 - Flags: review?(wchen)
(In reply to Julien Wajsberg [:julienw] from comment #6)
> I don't exactly know what "clearLockScreen" is supposed to do. Is it only
> clearing the notifications displayed in the lockscreen, but they still are
> in the notification screen ?

Yep.
master: b2438e3ce5ea183424ede61ad005dc66e7082989

after I pushed bug 901856, I noticed that the onclick/onclose notifications don't work, at least on B2G. More bugs for Gregor and Mike ;)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
(In reply to Julien Wajsberg [:julienw] from comment #9)
> master: b2438e3ce5ea183424ede61ad005dc66e7082989
> 
> after I pushed bug 901856, I noticed that the onclick/onclose notifications
> don't work, at least on B2G. More bugs for Gregor and Mike ;)

Can you file followup bugs for that.
Keywords: verifyme
QA Contact: jsmith
Verified per completion of initial test pass.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Depends on: 937929
No longer depends on: 937929
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: