Skip to content

Channel names allow case-variant duplicates (e.g., general and General) causing routing conflicts #39156

@sahillllllllll-bit

Description

@sahillllllllll-bit

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

  1. Create a channel named general
  2. Create another channel named General
  3. Both channels are created successfully
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugvalidA valid contribution where maintainers will review based on priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions