Skip to content

Unnoticed messages in the chat noticed on another device #7659

@iequidoo

Description

@iequidoo

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()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions