For troubleshooting questions, please post in the following format:
Summary
Mattermost server 5.19.1 LTS.
A newly created private channel somehow also appears in the “Direct Messages” category in the UI (besides the expected entry under “Private Channels”).
There it works as long as the correct team is active, and the channel fails to load if you click this wrong entry if another Team is active. (Probably as the Channel simply does not exist in this Team.)
Steps to reproduce
Not quite sure.
I created a Private Channel with the name “AE/CV/BEC-Compare-Abstimmungen diese Woche” (internal name: aecvbec-compare-abstimmungen-diese-woche),
added a bunch of users
and then noticed the strange entry.
Not sure when it appeared exactly.
Expected behavior
The private channel only appears in the “Private Channels” list / category, not under “Direct Messages”.
Hey there @GOhrner. From our tests we found a specific pattern which was reported in the bug that Sven mentioned : https://mattermost.atlassian.net/browse/MM-23427. However it seems to be a different pattern than the one you are experiencing. One of the workarounds I found from the tests was that if there were no dash (-) symbols it wouldn’t happen. Perhaps you might want to try removing the dash symbols from the channel name and test if it can avoid the behavior from happening?
As of now, I don’t see any workarounds available so far. I have tested this on my end across multiple versions and can confirm that the issue persists even after I removed the hyphens from the channel name and reloaded the app.
The issue actually just has to do with the length of the channel name so whether there are dashes or not doesn’t make a difference, any channel name with a length of 40 characters results in this bug for any version prior to the upcoming 5.22.
A work around would be to remove the existing Preferences entries generated in the database with a query like
DELETE Preferences FROM Preferences
INNER JOIN
Channels ON Channels.Id = Preferences.Name
WHERE
Preferences.category = 'group_channel_show'
AND
(Channels.Type = 'O' OR Channels.Type = 'P')
I tried to run the SQL query on 5.21 with the affected channel but the it continues to be displayed in both Private and Direct Messages even after I clear the cache and logged out from the desktop app:
mysql> DELETE Preferences FROM Preferences INNER JOIN Channels ON Channels.Id = Preferences.Name WHERE Preferences.category = 'group_channel_show' AND (Channels.Type = 'O' OR Channels.Type = 'P');
Query OK, 2 rows affected (0.01 sec)
May I know if there are any additional step that I need to perform after running the SQL statement?
The cache would have to be cleared from the system console afterwards
edit: Actually I dont think this would work the sys console cache is for sessions - I think one way would be to run the query and then immediately reboot the server