Replacing notification with tag fires events with different order on Windows; show happens before close
Categories
(Core :: DOM: Notifications, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox137 | --- | fixed |
People
(Reporter: saschanaz, Assigned: saschanaz)
References
Details
Attachments
(1 file)
new Notification("foo", { tag: "foo" }).onclose = console.log;
new Notification("bar", { tag: "foo" }).onshow = console.log;
With the above code, close fires before show on all other browsers/platforms: Firefox on macOS/LinuxXUL, Chrome on Windows/macOS/Linux, and Safari. Only Firefox on Windows fires close event first.
Perhaps this depends on the OS behavior, but I'd like to see why we behave different when Chrome does not.
Updated•1 year ago
|
| Assignee | ||
Comment 1•10 months ago
|
||
Because we just unregister the old handler late: https://searchfox.org/mozilla-central/rev/e85232b4b28ecc970240d39203e417d1c320623c/widget/windows/ToastNotification.cpp#517
| Assignee | ||
Comment 2•10 months ago
|
||
This makes sure we get the consistent behavior for every platform (except Android for now).
| Assignee | ||
Comment 3•10 months ago
|
||
Actually it turns out the libnotify backend is also bugged while the XUL implementation works fine.
| Assignee | ||
Comment 4•10 months ago
•
|
||
Err, it looks like libnotify uses sync call to dbus and thus has no success callback, while Chrome uses async call and thus has one. Meaning we can't get close callback while creating notification. 🤔
Comment 5•10 months ago
|
||
Does that also mean we're synchronously blocking the parent process main thread when doing that too?
| Assignee | ||
Comment 6•10 months ago
|
||
Unfortunately yes.
Comment 9•10 months ago
|
||
| bugherder | ||
Description
•