From 5b37cf881bb78c7f4aeff142b3b665f094da64a3 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:03:54 +0000 Subject: [PATCH] android, desktop, ios: keep pending invitee preview on the support message, not a re-covering group event A pending invitee's member-support no-content group events (SGEUserPendingReview on the PendingApproval->PendingReview transition, member-connected/E2EE/feature items) are delivered as new chat items in member-support scope. The pending preview took the newest item, so such an event re-covered the first message and rendered as the static "reviewed by admins" text. Prefer a content message: a no-content item no longer displaces an already-shown message. --- apps/ios/Shared/Model/ChatModel.swift | 11 ++++++----- .../kotlin/chat/simplex/common/model/ChatModel.kt | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/ios/Shared/Model/ChatModel.swift b/apps/ios/Shared/Model/ChatModel.swift index 92c0b39db0..ab7d2b6d9d 100644 --- a/apps/ios/Shared/Model/ChatModel.swift +++ b/apps/ios/Shared/Model/ChatModel.swift @@ -661,11 +661,12 @@ final class ChatModel: ObservableObject { chats[i].chatItems = switch cInfo { case .group: if let currentPreviewItem = chats[i].chatItems.first { - // For a pending invitee the support item (received via the broker clock) is the - // reason this preview updates; its itemTs isn't comparable to a locally-stamped - // group event, so always surface it rather than dropping it on a cross-clock check. - if cInfo.groupInfo?.membership.memberPending ?? false - || cItem.meta.itemTs >= currentPreviewItem.meta.itemTs { + // For a pending invitee, surface the latest support message in the preview (its + // broker-clock itemTs isn't comparable to a locally-stamped group event), but don't + // let a no-content group event re-cover a message already shown ("reviewed by admins"). + if cInfo.groupInfo?.membership.memberPending ?? false { + (cItem.content.hasMsgContent || !currentPreviewItem.content.hasMsgContent) ? [cItem] : [currentPreviewItem] + } else if cItem.meta.itemTs >= currentPreviewItem.meta.itemTs { [cItem] } else { [currentPreviewItem] diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index 26e925791c..88c7b6d8e4 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -546,11 +546,12 @@ object ChatModel { is ChatInfo.Group -> { val currentPreviewItem = chat.chatItems.firstOrNull() if (currentPreviewItem != null) { - // For a pending invitee the support item (received via the broker clock) is the - // reason this preview updates; its itemTs isn't comparable to a locally-stamped - // group event, so always surface it rather than dropping it on a cross-clock check. - if (cInfo.groupInfo_?.membership?.memberPending == true || - cItem.meta.itemTs >= currentPreviewItem.meta.itemTs) { + // For a pending invitee, surface the latest support message in the preview (its + // broker-clock itemTs isn't comparable to a locally-stamped group event), but don't + // let a no-content group event re-cover a message already shown ("reviewed by admins"). + if (cInfo.groupInfo_?.membership?.memberPending == true) { + if (cItem.content.hasMsgContent || !currentPreviewItem.content.hasMsgContent) cItem else currentPreviewItem + } else if (cItem.meta.itemTs >= currentPreviewItem.meta.itemTs) { cItem } else { currentPreviewItem