mattermost / mattermost

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..
https://mattermost.com
Other
30.45k stars 7.29k forks source link

Unread direct message stays after user deletion #22781

Open dwaxweiler opened 1 year ago

dwaxweiler commented 1 year ago

Summary

The direct message of a deleted user stays as unread.

Steps to reproduce

  1. User A sends a direct message to user B.
  2. User B reads the direct message.
  3. User B marks the direct message as unread.
  4. User A is deleted.

Maybe, steps 2 and 3 are not even necessary, but I have not test environment for trying this.

Expected behavior

User B sees nothing of user A after user A is deleted.

Observed behavior (that appears unintentional)

amyblais commented 1 year ago

@dwaxweiler What Mattermost server version are you on?

dwaxweiler commented 1 year ago

@amyblais I discovered the issue in version 7.7.1, and it is still visible after upgrading to version 7.9.1.

amyblais commented 1 year ago

Thanks, opened https://mattermost.atlassian.net/browse/MM-51983.

sinansonmez commented 1 year ago

@dwaxweiler I am trying to replicate and fix the issue. However I was not able to replicate it on my local. I deactivated the user but I am still seeing the message with archived icon under Direct Messages. Do you mean something different by user deleted than user deactivated?

Screenshot 2023-08-19 at 14 03 30
larkox commented 1 year ago

@dwaxweiler How are you deleting the user? Hard delete through mmctl or the database?

As @sinansonmez pointed, this should not happen if the user is deactivated (the "correct" way to delete users). If you refresh the web app, does it get fixed?

dwaxweiler commented 1 year ago

@sinansonmez @larkox I deleted the user using mmctl, but I don't remember whether I deactivated them first or not.

Refreshing the web application did not help back then, but I could remove this chat via the Android app.

sinansonmez commented 1 year ago

@larkox any suggestion on how to replicate this?

larkox commented 1 year ago

@sinansonmez This would be my guess:

That should reproduce it, but not 100% sure.