How to fix unread mention that does not go away

We are using Mattermost 7.8.1 (docker image) and a user recently complained that he consistently gets a “unread mention” in the Desktop App as well as when signing in directly in the browser. However clicking onto the notification did not help and also the tab “unread messages” was empty.

I searched the web but did not find any solution or explanation for the behavior. I was able to fix the problem using a database query (we’re using Postgres, but it should be similar in MariaDB/MySQL):

  1. Get the ID of the user that is observing the problem
    → select * from users where email like ‘user_id@our_domain.tld’;
    In my case let’s assume the user ID is ajicuzb6l0dh8g9t6zg3xk3s7y

  2. Delete thread memberships that have not been viewed and have an unread mention (beware if a user was recently invited to a new thead this one will be deleted as well, you might want to add limit 1)
    → delete from threadmemberships where userid=‘ajicuzb6l0dh8g9t6zg3xk3s7y’ AND lastviewed=0 AND unreadmentions>0;

  3. Problem was solved

Out of curiosity we tried to replicate the problem by adding the user to threads, mentioning him and deleting the thread before it was read. We were unable to replicate the problem.

Hi @tristanhoffmann and welcome to the Mattermost forums!

Are you using collapsed reply threads for this user? If so, this is currently under investigation I think and a workaround is to mark all threads read to get rid of this notification:


1 Like

Thanks for your reply. Yes we have enabled collapsed reply threads for all users.
The fix you suggested is what we tried as well, but it seems like the button is not only greyed out but also does not work when there is no unread thread displayed in the Mattermost client.

You can mark any message as unread and then the button should appear and clicking on it should clear the status also for the “ghost” entry - can you confirm?

OK that is a good idea - if the problem occurs again we will test this and report back.