Files
simplex-chat/apps/multiplatform/common
Narasimha-sc 10c905dbdd android, desktop: fix chat preview and unread counter updating wrong chat
ChatsContext has two live instances: the primary chat list and the
secondary context used by the reports and member support views.
In addChatItem the chat index is resolved against the receiver context
(getChatIndex reads this.chats), but the list being read and written was
chatsContext.chats - always the primary singleton. On the secondary
context the two lists hold different chats in a different order, so the
index pointed at an unrelated chat in the main list, which then received
the last message preview, the unread increment and the pop to the top.

Use the receiver context's own list, as every other method in the class
already does. This reverts the unintended part of b97e1e0f1 and keeps its
memberPending guard.
2026-08-19 09:24:11 +00:00
..