RocketChat / RocketChat/Rocket.Chat
Team Channels search returns no results when query includes leading or trailing whitespace
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Searching for channels in the Team Channels panel returns no results when the search query contains leading or trailing whitespace.
For example, searching for general correctly returns the matching team channel, while searching for general , general, or general returns no results even though the search term is otherwise identical.
Steps to reproduce:
- Open any team.
- Open the Team Channels panel.
- Search for an existing channel using its name (for example,
general) and verify that it is returned. - Search again using the same channel name with leading or trailing whitespace (for example,
general,general, orgeneral).
Expected behavior:
Leading and trailing whitespace should be ignored, and the search should return the same channels as the trimmed search term.
Actual behavior:
No matching channels are returned when the search query contains leading or trailing whitespace.
Screenshot / Screen Recording:
https://github.com/user-attachments/assets/ac57458a-2337-4fd6-bb40-ef4152b312e4
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 query. Empty searches continue to behave as expected and display the available team channels.
Relevant logs:
No relevant server or browser errors were observed.
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 at the Team Channels panel and trace how its search query is handled, then reproduce the issue with leading and trailing whitespace around an existing channel name such as general. Done means whitespace-padded queries return the same channels as the trimmed query, while empty searches continue to show available channels; verify the behavior in the Team Channels search flow.
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
- Clearly specified
- Newbie friendliness
- 68/100