unreadMessages
unreadMessages is a term used in messaging applications to refer to the set of messages that have not yet been read by a user. Depending on implementation, unreadMessages may be stored as an integer counter representing the total number of unread messages for a user across conversations, or as a per-conversation collection of message identifiers that are unread.
In practice, unreadMessages is used to display badges, drive notification prompts, and optimize data loading by
Updating rules: when a new message arrives in a conversation and the user has not opened it,
Edge cases include messages that are deleted or expired while unread, or conversations with muted notifications
Security and privacy considerations include exposing unread counts in analytics or UI, and ensuring that unread