RocketChat / RocketChat/Rocket.Chat
Bio validation incorrectly counts leading/trailing spaces toward max length
Nobody has claimed this yet.
- 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:
- Go to Profile → Edit Profile.
- In the Bio field, enter:
- 260 characters of actual text.
- Add multiple spaces at the beginning and/or end.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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