Artemis
Artemis copied to clipboard
Notification get marked as read even if they were not loaded
Describe the bug
Notifications in Artemis are marked as read by opening the sidebar and waiting a bit. However, the notifications are not refreshed when the sidebar is opened.
Details
Given you know that you a group notification was generated:
- The Notification Icon does not show that there is a new notification
- You open the sidebar
- Still no notification visible
- You reload
- The Notification Icon still does not show that there is a new notification
- You open the sidebar again
- There is the new notification, but it is not displayed as new.
But given the same situation:
- The Notification Icon does not show that there is a new notification
- You do not open the sidebar
- You reload
- The Notification Icon does show that there is a new notification
- You open the sidebar again
- There is the new notification and it is displayed as new.
Solution
We should only mark notifications as read if they actually got read, meaning they got displayed. The client should send the IDs of the read notifications, not just use the current time because it will never be guaranteed that all notifications have been sent to the client at that time (e.g. connection could break temporarily).
Improvement
It would be a good intermediate solution to load new notifications when opening the sidebar and only start marking them as read if this operation was successful.
Our current database structure does not allow to store for each user when a particular notification was read, therefore we have a limited functionality with the last timestamp a user has accessed the notifications.
We could extend this, but this would take quite some time as the database structure would need to be adapted.
Ok, then we should at least make sure that all new notifications up to a certain time are loaded and displayed before making them as read.