RocketChat / RocketChat/Rocket.Chat

Room Members panel search fails with leading or trailing whitespace

Open
#41,639 1 comment 1 reaction 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:

Searching for members in the Room Members panel fails when the search term contains leading or trailing whitespace.

For example, searching for preeti correctly returns matching members, while searching for preeti or preeti returns no results, even though the search term is otherwise identical.

Steps to reproduce:
  1. Open any channel or private group.
  2. Open the Members panel.
  3. Search for a member using a valid username or display name (e.g. preeti) and verify that the member is returned.
  4. Search again using the same term with leading or trailing whitespace (e.g. preeti , preeti, or preeti).
Expected behavior:

Leading and trailing whitespace should be ignored, and the search should return the same results as the trimmed search term.

Actual behavior:

No matching members are returned when the search term contains leading or trailing whitespace.

Screenshot:

https://github.com/user-attachments/assets/a111afb7-8a32-4b88-875b-fbaf1054974d

Server Setup Information:
  • Version of Rocket.Chat Server: 8.7.0-develop
  • License Type: Community
  • Number of Users: N/A
  • Operating System: Ubuntu (WSL2)
  • Deployment Method: Development
  • Number of Running Instances: 1
  • DB Replicaset Oplog: N/A
  • NodeJS Version: 22.22.1
  • MongoDB Version: 7.0.16
Client Setup Information
  • Desktop App or Browser Version: Google Chrome
  • Operating System: Windows 11
Additional context

The issue is reproducible with both leading and trailing whitespace in the search term. Empty searches continue to work as expected.

Relevant logs:

No relevant server or browser errors were observed.

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

Locate the Room Members panel and its member-search entry point, then inspect any existing frontend tests for search behavior. Reproduce the issue with leading and trailing spaces, update the search handling so those terms return the same results as the trimmed term, and verify that empty searches still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.