Closed Bug 1890560 Opened 1 year ago Closed 10 months ago

Replacing notification with tag fires events with different order on Windows; show happens before close

Categories

(Core :: DOM: Notifications, defect, P3)

defect

Tracking

()

RESOLVED FIXED
137 Branch
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.

Severity: -- → S3
Priority: -- → P3

This makes sure we get the consistent behavior for every platform (except Android for now).

Actually it turns out the libnotify backend is also bugged while the XUL implementation works fine.

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. 🤔

Does that also mean we're synchronously blocking the parent process main thread when doing that too?

Unfortunately yes.

See Also: → 1946707
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a0dbaa387380 Call UnregisterHandler earlier for the old handler r=asuth,nalexander,win-reviewers,gstoll
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50761 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: