RocketChat / RocketChat/Rocket.Chat
Fix incorrect user count in getUsersOfRoom (includes deactivated users)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
While reviewing apps/meteor/server/methods/getUsersOfRoom.ts, I noticed an existing TODO indicating that deactivated users are currently being included in the total user count:
The current implementation counts subscriptions based on the existence of a username, which also includes users that have been deactivated. This results in the total value including users who should no longer be considered active members of the room.
Proposed direction (seeking confirmation before implementation):
- Update the total calculation to exclude deactivated users, in line with the existing TODO
- Ensure deactivated users are excluded from the count
- Keep total and records.length consistent
I’d be happy to work on this fix and submit a PR once the preferred approach is confirmed.
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
Read apps/meteor/server/methods/getUsersOfRoom.ts, starting at the existing TODO and the subscription count calculation. Confirm the preferred way to identify deactivated users, then ensure they are excluded and that total matches records.length.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100