Open Bug 1932393 Opened 3 months ago Updated 4 days ago

Introduce a common notification ID between NotificationDB and Alerts backends

Categories

(Core :: DOM: Notifications, task)

task

Tracking

()

People

(Reporter: saschanaz, Assigned: saschanaz)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Currently we have three different ID for each notification:

  • Alert name: Generated by ComputeAlertName. This is the one used to have an alert map within alerts backends. It's deterministic but not unique enough to cover different profiles.
  • Notification::mID: This is the ID for notification DB. It's just UUID, it's unique but not deterministic at all.
  • Windows Tag: Generated by InitWindowsTag. Windows backend specific, deterministic and unique.

Given ComputeAlertName is now called in the parent process, we should be able to port InitWindowsTag for all backends.

Note for me:

Currently Notification generates ID, PNotification generates alertName, Windows backend generates WindowsTag. Maybe let AlertNotification generate the ID during Init() and use that for notification storage and ShowAlert(). That way chrome callers would also get the same code path for id generation.

See Also: → 1847096
Depends on: 1945501
Depends on: 1945801
No longer depends on: 1945501
Attachment #9463149 - Attachment description: WIP: Bug 1932393 - Add nsIAlertNotification.uid → WIP: Bug 1932393 - Add nsIAlertNotification.id

It's currently being called on creation instead of on show. That can cause unexpected order of persistence handling for tagged notifications, as closing previous same-tagged notification happens after the second notification creation, which means we persist the second one and then unpersist the first one. That's currently okay as each notification is being handled with UUID, but becomes a problem when we start to use deterministic notification IDs with which same tagged notifications share the same ID.

Attachment #9463149 - Attachment description: WIP: Bug 1932393 - Add nsIAlertNotification.id → WIP: Bug 1932393 - Part 2: Add nsIAlertNotification.id
Attachment #9464439 - Attachment description: WIP: Bug 1932393 - Part 1: Defer calling PersistNotification until alertshow r=asuth → Bug 1932393 - Part 1: Defer calling PersistNotification until alertshow r=asuth
Attachment #9463149 - Attachment description: WIP: Bug 1932393 - Part 2: Add nsIAlertNotification.id → Bug 1932393 - Part 2: Add nsIAlertNotification.id r=nrishel,nalexander
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: