RocketChat / RocketChat/Rocket.Chat
Can't use term for search in account custom fields if channel matches the same name.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Can't use specific term for search which are in account custom fields and channel matches the same term.
We create a custom field for users so everybody can search for a department name and bring the list of the people which works there. We thought about using a custom field with the department name because we use an IM app which the ppl were listed in groups as departments like HR, IT etc. So if you need to talk with someone in IT you would go to the app and see in the IT group who was online without the need to know who works in there.
We're deploying Rocket.Chat at our work and everybody liked the tool, but "the major concern" is still not being able to list all people online as other (old) IM apps and setting the custom field department through syncing LDAP is the perfect solution for now as anyone can search the term IT and it will bring all ppl with the department IT without knowing who works there.
Steps to reproduce:
- We create a channel with the name of el-contabilidade;
- Create a custom field to sync from LDAP the field department and show it in the user info
- Search "contabilidade" and it will bring only the channel and not the users
- If you aren't a member of the channel with the same name it will list the users with the custom field department "contabilidade" and the channels that matches it if it's public.
Expected behavior:
If I search for a term it should only bring the results of the people with the custom field which matches the term and the public channels.

Actual behavior:
If I search for a specific term and we have a channel which contains the specific/part of it and you're a member of the channel
it will bring only the channel and not the other people with the custom field filled. If I use the Directory Listing it works as expected.

Server Setup Information:
- Version of Rocket.Chat Server: 3.10.0
- Operating System: Ubuntu
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: v12.18.4
- MongoDB Version: 4.0.18
Client Setup Information
- Desktop App or Browser Version: Desktop App and Chrome Version 87.0.4280.88
- Operating System: macOS but we tested in Windows 10 too.
Additional context
It's a minor bug but still a bug in our view because it will only affect a small percentage of users but it would affect new users which in our case is basically all our users as they are being presented to Rocket.Chat only now.
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 by reproducing the search with a channel name matching a user custom-field value, comparing the results for channel members and non-members. Trace the search entry point and the Directory Listing behavior to find where matching results are filtered. Done means a search returns the matching users and permitted public channels together.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100