mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
The unread dot for Marmot/MLS group rooms was driven by an in-memory unreadCount on MarmotGroupChatroom. On restart the MLS group state is restored from the last persisted commit, the kind:445 subscription restarts with since=null, and the in-memory processed-event dedup set is empty — so relays redeliver old group events, they re-decrypt as fresh application messages, and the counter was re-bumped, resurrecting the dot for chats already read. Marking-as-read was already persisted: opening a group chat writes the newest rendered message's createdAt to the MarmotGroup/<groupId> route in lastReadPerRoute (saved to disk with account settings). Compute the unread indicators from that timestamp instead — exactly how DM rooms and public channels do it — in both the Messages screen row and the Marmot group list row. With no consumer left, drop the volatile counter and collapse the addMessageSync/restoreMessageSync split (they only differed in the counter bump).