Open Bug 1095073 Opened 6 years ago Updated 2 years ago

Web Notifications API persisting notifications in local notificationstore.json

Categories

(Core :: DOM: Core & HTML, defect, P5)

35 Branch
x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: adam, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36

Steps to reproduce:

If a website does not account for and `.close()` every notification created on that site, the data of that notification persists in the local notificationstore.json file.

To reproduce, create several notifications on a site that's been given permission to display notifications:
  notif1 = new Notification("title", {body: "body 1", tag: "example_tag"})
  notif2 = new Notification("title", {body: "body 2", tag: "example_tag"})


Actual results:

With the previous example, two entries are created in notificationstore.json.  If the website does not explicitly `.close()` each notification, they remain there for at least several weeks (I can't tell if they'll eventually timeout and be cleared or not), and continue to remain even after several hundred more notifications are created using the same tag attribute.

Visually, it behaves as expected and only the latest notification is shown.


Expected results:

If the same tag attribute is used, it should replace the previous notification (not just visually, but in this storage file as well).  See the W3C entry for Web Notification tags: http://www.w3.org/TR/notifications/#tags-example

I can't say what the expected behavior is for notifications that do have unique tag attributes, but the current implementation doesn't seem ideal.  It appears that the notifications will pile up indefinitely (is there some way that I'm not aware of for a user to view these old notifications in order to clear them?).

Site developers should account for every notification and `.close()` them, but if they don't, it could result in a large notificationstore.json file that contains logs of old chat messages for apps that use this api for chat notifications, for example.
Component: Untriaged → DOM
Product: Firefox → Core
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.