status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.9k stars 985 forks source link

All replies and mentions are removed in AC for receiver after sender removes the last message in community chat #17052

Closed VolodLytvynenko closed 1 month ago

VolodLytvynenko commented 1 year ago

Steps to reproduce:

  1. User_A and User_B are both in the same community.
  2. User_A sends several replies or mentions to User_B.
  3. User_A sends one more message and then deletes it using the 'delete for everyone' option.
  4. User_B checks the AC.

Actual result:

All mentions and replies in the AC are removed for User_B.

Expected result:

Mentions and replies should not be removed from the AC after the last message is deleted.

Additional info:

This issue is similar in group chats, with the exception that only replies are removed from the AC. Mentions are not removed and

cammellos commented 1 year ago

@ajayesivan any update on this?

ajayesivan commented 1 year ago

@cammellos unread-notification count & notification list values coming from status-go API is wrong. I'm looking into the DeleteActivityCenterNotificationForMessage function in status-go.

churik commented 3 months ago

still valid and very weird bug (checked on nightly 21/06/24)

yqrashawn commented 3 months ago

CleanShot 2024-07-15 at 13 22 13@2x

so all notifications have the same last-message and status-go delete notification by matching to-be-deleted-message-id with both notification message id and notification last-message id code at

https://github.com/status-im/status-go/blob/131cfe7b3daec24f2ea56bdfa3b26ab931ea7a0f/protocol/activity_center_persistence.go#L62-L70

    for _, notification := range notifications {
        if notification.LastMessage != nil && notification.LastMessage.ID == messageID {
            withNotification(notification)
        }

        if notification.Message != nil && notification.Message.ID == messageID {
            withNotification(notification)
        }
    }
yqrashawn commented 3 months ago

last message check is added at https://github.com/status-im/status-go/pull/2854 in order to fix https://github.com/status-im/status-mobile/issues/13933

yqrashawn commented 2 months ago

next up: https://github.com/status-im/status-go/pull/5520#issuecomment-2270223309