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):
-
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 -
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; -
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.