RocketChat / RocketChat/Rocket.Chat

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

Open
#39,156 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug valid
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

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
  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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating getValidRoomName and inspect how it checks for duplicate channel names. Add coverage for creating both general and General, then verify that the second creation is rejected and that existing case-insensitive routing remains consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.