RocketChat / RocketChat/Rocket.Chat

Bio validation incorrectly counts leading/trailing spaces toward max length

Open
#39,209 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

Bio length validation currently counts leading and trailing spaces toward the maximum limit (260 characters), even though the trimmed value is ultimately stored.

This creates inconsistent behavior where a bio that is valid after trimming (e.g., 260 characters of actual content with extra spaces around it) is rejected by the frontend or backend validation.

The validation logic should consistently use the trimmed value when checking length to match the stored value and avoid unexpected rejections.

Steps to reproduce:

  1. Go to Profile → Edit Profile.
  2. In the Bio field, enter:
    • 260 characters of actual text.
    • Add multiple spaces at the beginning and/or end.
  3. Click Save.
Current Behavior

The form rejects the input with:

Expected behavior:

Validation should consider the trimmed value.
If the trimmed bio is 260 characters or fewer, it should be accepted and saved successfully.

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 with the Profile → Edit Profile flow and trace the Bio validation in both the frontend and backend. Reproduce the case with 260 characters surrounded by spaces, then verify that a trimmed value of 260 characters or fewer is accepted and saved successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, frontend
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.