deltachat / deltachat-desktop

Email-based instant messaging for Desktop.
GNU General Public License v3.0
909 stars 167 forks source link

Notifications of previous sessions don't work #2438

Open Simon-Laux opened 2 years ago

Simon-Laux commented 2 years ago

when closing DeltaChat it's notifications stay, but even after re-opening DC they don't work anymore (you can click on them all you want nothing happens, at least on MacOS). Furthermore those notifications are not cleared, when reading the messages they belong to.

This is likely an electron issue, so the only thing we could do is trying to clear notifications on exiting DeltaChat, but that might not be a good idea, because they could sometimes remind the user of messages they missed. So maybe we should close this with the #wont-fix label for now?

Simon-Laux commented 2 years ago

see also #2199 and #2198

Simon-Laux commented 1 year ago

looks like this is an general electron problem: https://github.com/electron/electron/issues/32261

Simon-Laux commented 6 months ago

signal seems to close all notifications when you close the app, this could maybe also be an option

nicodh commented 1 month ago

Since electron "forgets" about all exisiting notifications when closed and there is no chance to access the existing system notifications on start we can't solve this.

Simon-Laux commented 1 month ago

It is possible when we use the system apis directly, it is quite common to do that with electron. for example there is a popular npm package for advanced windows notifications (https://www.electronjs.org/de/docs/latest/tutorial/notifications#use-advanced-notifications).

the apis we can use on MacOS https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/getdeliverednotifications(completionhandler:) https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/removedeliverednotifications(withidentifiers:)

On windows I'm not sure, could be this: https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.toastnotificationhistory?view=winrt-26100

Linux has dbus, so I assume it's also possible to track notifications via the id across multiple sessions: https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html