RocketChat / RocketChat/Rocket.Chat

API: Incorrect usersCount from response

Open
#35,266 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

The usersCount value returned from several endpoints appears incorrect. The value does not match the total member count retrieved from rooms.membersOrderedByRole.

Steps to reproduce:
  1. Call the channels.counters endpoint for a specific channel.
  2. Compare the usersCount from the above endpoints with the member count retrieved from rooms.membersOrderedByRole.
Expected behavior:

The usersCount value from channels.counters, rooms.info, method.call/getRoomByTypeAndName, and directory should match the total count of members from rooms.membersOrderedByRole.

Actual behavior:

The usersCount from these endpoints is inconsistent and does not match the total retrieved from rooms.membersOrderedByRole.

Screenshot
Image
Server Setup Information:
  • Version of Rocket.Chat Server: 7.4.0

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

Start by tracing how usersCount is produced for channels.counters, rooms.info, method.call/getRoomByTypeAndName, and directory, then compare each result with rooms.membersOrderedByRole. Confirm the expected count semantics and check existing coverage around these endpoints. Done means all named endpoints consistently report the total member count.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.