RocketChat / RocketChat/Rocket.Chat

Notifications broken for old users not matching current name validation

Open
#14,444 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

After setting more restrictive name validation by
replacing [0-9a-zA-Z-_.]+ with [0-9a-z-_.]+ (i.e. disallowing uppercase letters)
old users with usernames containing uppercase characters
can no longer be mentioned (and doesn't get notifications)

Steps to reproduce:
  1. Go to Settings -> General -> UTF8 -> UTF8 Names Validation
  2. Set it to something without uppercase letters: [0-9a-z-_.]+
  3. Try to mention existing user with uppercase character such as @Alice
Expected behavior:

New user @Bob can't be created because doesn't pass name validation.
Existing user @Alice can log in.
Mentioning @Alice works, @Alice is turned into link, @Alice is notified.

Actual behavior:

New user @Bob can't be created because doesn't pass name validation. (OK)
Existing user @Alice can log in. (OK)
Mentioning @Alice doesn't work, @Alice is not turned into link, @Alice is not notified. (NOT OK)

Server Setup Information:
  • Version of Rocket.Chat Server: 1.0.2
Other notes

To be honest I'm not that sure if that's a bug, I just assumed that if existing users whose usernames are no longer valid, given new UTF8 Names Validation rules, can still log in to chat, then all other features should work for them.

Other way would be to temporarily deactivate "invalid" (According to new rules) accounts, until they will be renamed to valid ones. But I guess that would be an overkill.

Possibly related with #10253 and partially with #956 and #7280

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

No files, tests, or entry points are named. Reproduce the issue with UTF8 Names Validation set to [0-9a-z-_.]+, then trace mention linking and notification handling for an existing uppercase username such as @Alice. Done means existing users can log in, be linked when mentioned, and receive notifications while new invalid names remain rejected.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.