Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: windows notifications not closing #29557

Closed
3 tasks done
Araxeus opened this issue Jun 6, 2021 · 5 comments
Closed
3 tasks done

[Bug]: windows notifications not closing #29557

Araxeus opened this issue Jun 6, 2021 · 5 comments
Labels

Comments

@Araxeus
Copy link

Araxeus commented Jun 6, 2021

Preflight Checklist

Electron Version

12^

Operating System Version

Windows 10 v19042

What arch are you using?

x64

Last Known Working Electron version

11 downwards

Expected Behavior (Electron 11 and older)

notifications would close after timeout, not appearing the windows 10 notification center. (and thus not duplicating)

In the gist with v11 you can see it logs "notification closed" when it timeout

Actual Behavior (Electron 12 and newer)

After the notification timeout - it moves to the notification center without closing and also can't be closed programmatically
(notification.close doesn't do anything IF it has already timeout and moved to notification center)

which can result in a spam of notifications in notification center

In the gist with v12/13 you can see the notification doesn't close on timeout + oldNotification.close() only works if the old notification hasn't timed out yet

Testcase Gist URL

https://gist.github.com/a1c1ac4c057370540be18e0b5aeefb89

Additional Information

I found no documentation or breaking change that indicate any modifications in notification API

reported at th-ch/youtube-music#312
tested by me on multiple versions of electron 11, 12 and 13 - including latest releases

if this doesn't get directly fixed - there should atleast be an option "close on timeout" that allows using that functionality and avoid spamming the notification center

@zcbenz zcbenz added 12-x-y 13-x-y component/notifications platform/windows has-repro-gist Issue can be reproduced with code at https://gist.github.com/ labels Jun 16, 2021
@RandomEngy
Copy link

I think the expected behavior is that the notification stays in the notification center until it's dismissed by the user there, or dismissed manually by notification.close().

But the problem is that notification.close() doesn't seem to be working. I call it and the notification stays in the notification center. I'm using Electron 16.0.4.

@RandomEngy
Copy link

Looking at the spec: https://notifications.spec.whatwg.org/#lifetime-and-ui-integrations

The user agent must keep a list of notifications, which is a list of zero or more notifications.

User agents should run the close steps for a non-persistent notification a couple of seconds after they have been created.

User agents should not display non-persistent notification in a platform’s "notification center" (if available).

User agents should persist persistent notifications until they are removed from the list of notifications.

A persistent notification could have the close() method invoked of one of its Notification objects.

User agents should display persistent notifications in a platform’s "notification center" (if available).

It used to just treat it as a non-persistent notification, but now it looks like it has aspects from both. It keeps it in the notification center but also is still firing the close handler after the popup disappears and is ignoring .close() invocations after that point.

Does electron even have official support for persistent notifications?

@Araxeus
Copy link
Author

Araxeus commented Jan 31, 2022

Any news on this?

Notifications should really conform to some specs

  • why can't notifications be removed from the notification center? (notification.close() doesn't work)
  • why isn't there an option to for "non persistant notifications" which don't display in the notification center?

I can confirm this is still broken on v16.0.8

@Araxeus Araxeus changed the title [Bug]: windows notification not closing on timeout [Bug]: windows notifications not closing Jan 31, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Oct 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2022

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants