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

Web Notifications API: notifications don't always close from Mac Notification Center when close function is called #24290

Closed
3 tasks done
jflasch opened this issue Jun 24, 2020 · 0 comments · Fixed by #24302
Closed
3 tasks done

Comments

@jflasch
Copy link

jflasch commented Jun 24, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • v8.3.1
  • Operating System:
    • macOS 10.14.6
  • Last Known Working Electron version:
    • N/A

Expected Behavior

I have a simple electron app that generates a notification when a button is clicked. Before the new notification is generated, close() is called on the last notification. I would expect that each time the button is clicked, the existing notification closes and a new one pops up.

Actual Behavior

When the button is clicked a new notification is generated, but the old notification does not close. It is important to note that I am logging in the onclose event handler for all notifications, and this log shows that all notifications are being closed successfully even though they remain in the Mac Notification Center. I also have logs in the onerror event handler for each notification, and these logs are never getting printed, so no errors are occurring.

To Reproduce

Using the sample app provided in the fiddle link below, click on the 'Generate Notification' button ~20 times. Do some clicks back to back, and spread out some clicks by a few seconds. Check the Mac Notification Center and you will see that most of the notifications are still there, even though only the most recent notification should be there. There are rare occasions where the close does work, but it is still unknown how to reproduce this result consistently. Check the renderer logs as well to see that the onclose function was triggered for each notification, even though they are still in the Notification Center.

Electron Fiddle Link: https://gist.github.com/fd16a663434667d2096cd31ec7f2662f

Additional Information

This problem is only seen when running an electron app on Mac. If you run the exact renderer.js and index.html files from the fiddle code in a real chrome web browser, it works correctly (old notifications always clear when new ones come in).
I have confirmed that nodeIntegration and the notification option requireInteraction have no effect on this regardless of if their values are true or false.

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

Successfully merging a pull request may close this issue.

2 participants