Bug 247978

Summary: notificationclose event not firing when notification cleared
Product: WebKit Reporter: Andy <andy>
Component: Service WorkersAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: andy, beidson, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Intel)   
OS: macOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=268797

Description Andy 2022-11-16 07:45:17 PST
the event 'notificationclose' does not fire when user closes a web push notification from notification center


To replicate:
- add the code below to service worker
- push a notification
- use web inspector on the service worker, with breakpoints for debugger enabled
- click the X for the notification

self.addEventListener('notificationclose', function (event) {
debugger;
})

expected outcome:
Safari Web Inspector pauses at the debugger line above

Actual outcome:
The event is never triggered
Comment 1 Radar WebKit Bug Importer 2022-11-16 22:13:55 PST
<rdar://problem/102451723>
Comment 2 youenn fablet 2022-11-18 08:18:45 PST
I am adding an API test at https://bugs.webkit.org/show_bug.cgi?id=248084.
The test seems to be working so maybe the issue is at Safari level.