notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Add a warning about the reliability of the notificationclose event

Open beverloo opened this issue 8 years ago • 4 comments

Not all platforms dispatch an event to the applications (e.g. the user agent) when a notification is dismissed, or only do so in a subset of cases. This means that the notificationclose event is a best-effort event. It adds significant value to the developer, as dismissal is a powerful (yet complicated) signal, so user agents should still make an effort to support it where they can.

Fixes #109


Preview | Diff

beverloo avatar Oct 20 '17 13:10 beverloo

PTAL @annevk and @hober

I decided to not amend the algorithm as the user agent would not know about either closing of the notification, or about whether it was user triggered, when this situation arises. Does that sound reasonable?

beverloo avatar Oct 20 '17 13:10 beverloo

The proposed change leaves the RFC 2119 MUST in place, though. I don't think this change is sufficient.

hober avatar Oct 23 '17 21:10 hober

Just changing the MUST to SHOULD imposes a significant change to the list of notifications concept. It would either be stale as deletion becomes optional (how will getNotifications() behave?) or would become a shared responsibility between the user agent and the underlying platform notification center. The second option means that the user agent will be aware of closed notifications, just not in a timely manner.

Instead, maybe we should somehow rephrase the event dispatching section (2.8.2.) to be limited to situations where the UA does know in a timely manner?

beverloo avatar Oct 25 '17 11:10 beverloo

Maybe something like:

When a notification is closed, either by the underlying notification platform or by the user, and the underlying notification platform exposes notification closure, the close steps for it must be run.

annevk avatar Oct 25 '17 12:10 annevk