-
-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Labels
Description
Steps to reproduce (Core v2.35.0):
- Have a 1st device offline
- Receive a lot of messages in some chat
- Read the last screen of messages by scrolling to the bottom of the chat (there's a button in the UIs for that) on the 2nd device
- Bring the 1st device online
- See notifications and unnoticed messages ("badge counter") which won't be fixed until you e.g. open the chat and scroll to the bottom on the 1st device as well
Note that if the 1st device is online, the notifications are removed because Session::sync_seen_flags() emits MsgsNoticed, but unnoticed messages persist.
Suggested fix: when a seen message is received or a \Seen IMAP flag arrives for a message, mark all preceding (by timestamp_sort) chat messages as noticed and emit MsgsNoticed. EDIT: MsgsNoticed should only be emitted if no fresh messages remain, otherwise it removes useful notifications in the UIs.
There was #6415, but that fix is incomplete because it only emits the event. Tests from there can be reused though, but also there should be a test checking a number of fresh messages in the chat (ChatId::get_fresh_msg_cnt()).