fb-mac-messenger
fb-mac-messenger copied to clipboard
Notification is not cleared when it is clicked in Notification Center
Notifications stay in Notification Center until they are all manually cleared. I think when a notification is clicked, it should be cleared alongside other notifications that are related to the same conversation.
This is unfortunately due to a limitation of how notifications are implemented and the window.Notification API. Notifications in OS X are not "objects in memory" but completely managed by the system and cleared via APIs that accept per-app unique string keys. These keys are mapped to notifications in the JS environment (actually, owned by the web view's global JS context.) If the app is reloaded or restarted, that information is lost (unique keys).
A PR fixing this would be welcome, though it will probably require some decent skills in JavaScriptCore programming (memory management is hairy.)
Would it be sufficient to just clear all the notifications for the app when the app comes into focus? Or is that too much?