status-mobile
status-mobile copied to clipboard
Message preview and unread counter are displayed on the recipient's side if the message was sent and deleted while the recipient was offline
Bug Report
Problem
Message preview and unread counter are displayed on the recipient's side on the Home screen if the message was sent and deleted while the recipient was offline. The number of unread messages increases with every deleted message. The issue is relevant for all chat and messages types.
Expected behavior
No message on the recipient's side when returning online
Actual behavior
https://user-images.githubusercontent.com/67952253/160586085-8f7b6520-400b-4c04-900c-ff3541d97368.MP4
Reproduction
- Device1 and device2 start a 1-1 chat
- Device2 closes the app
- Device1 sends a message and deletes it
- Device2 logs in
Additional Information
- Status version: nightly 29/03
- Operating System: Android, iOS
Logs
I noticed something funny. When local notifications are switched on the receiving device the last message of a chat does not get updated when a message is deleted while the app is not active until the recipient replies in the chat. This behaviour also affects un-viewed messages counter and seems to have a relation with local notifications
The other case which I have managed to address is a scenario where the location notifications are switched off. The last message of a chat gets updated when a message is received, sent or deleted but the counter for un-viewed messages is not updated to account for the count of the deleted messages when the app on the receiving end is not active. This results in the count for un-viewed messages being more than the number of messages that have not been seen by the recipient. However this is something that I have looked into and solved on status-go and seems to work fine
One more scenario with public chat. User A: join any public chats, send several messages, delete the last one, log out User B: join same public chat
Expected result: no last message is shown Actual result: User B is seeing last message (deleted) in preview
@churik the issue for 1 on 1 chats is now resolved and it should also be resolved in the of public chats. I will however test to confirm that it works fine with public chats
The label recheck is added in order to keep an eye on it while testing this part of the redesigned app.