-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Description
Description
Room name validation currently performs a case-sensitive duplicate check in getValidRoomName.
However, routing, mentions, and search treat room names case-insensitively.
Because of this mismatch, channels that differ only by letter casing can be created.
Example:
general
General
Both rooms coexist in the database, but the application resolves them to the same route.
Opening:
/channel/General
redirects to:
/channel/general
This leads to incorrect navigation and mention behavior.
Steps to Reproduce
- Create a channel named
general - Create another channel named
General - Both channels are created successfully
- Visit
/channel/General
Expected behavior
The second channel creation should be rejected because channel names should be unique regardless of letter casing.
Actual behavior
Both channels are created, but routing redirects to the lowercase version, causing inconsistent behavior with navigation, mentions, and search.
Impact
- Incorrect channel routing
- Confusing mentions
- Broken navigation for users
- Duplicate logical channels
Proposed Solution
Normalize the room name (e.g., lowercase) before duplicate validation to enforce case-insensitive uniqueness.