Skip to content

Conversation

utkarshh7
Copy link

@utkarshh7 utkarshh7 commented Feb 19, 2025

Proposed changes (including videos or screenshots)

  • Updated the channels.counters endpoint to fetch the members count from the Subscriptions collection instead of the cached Rooms.usersCount.
  • Ensures accurate real-time member counts by querying the source-of-truth data.

Screenshot (API Response):

image

5 members present in the above image

Issue(s)

Closes #35266

Steps to test or reproduce

  1. Create a test channel and add multiple users (including bots/owners).
  2. Call the API: curl -H "X-Auth-Token: YOUR_TOKEN" "http://localhost:3000/api/v1/channels.counters?roomId=YOUR_ROOM_ID"
  3. Verify members matches the actual count from: curl -H "X-Auth-Token: YOUR_TOKEN" "http://localhost:3000/api/v1/rooms.membersOrderedByRole?roomId=YOUR_ROOM_ID" | jq '.members | length'

##Checklist

  • I have read the Contributing Guide.
  • I have signed the CLA.
  • Lint and unit tests pass locally (yarn lint & yarn test).
  • Tests added (not required for this backend fix).
  • Documentation not needed (no user-facing changes).

Further comments

  • This fix addresses data inconsistency by directly querying the Subscriptions collection, which tracks real-time channel memberships.
  • No breaking changes introduced.

Copy link
Contributor

dionisio-bot bot commented Feb 19, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR has conflicts, please resolve them before merging
  • This PR is missing the 'stat: QA assured' label
  • This PR is not mergeable
  • This PR is targeting the wrong base branch. It should target 7.11.0, but it targets 7.5.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Feb 19, 2025

⚠️ No Changeset found

Latest commit: 0481549

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@utkarshh7
Copy link
Author

utkarshh7 commented Feb 19, 2025

Maintainers, please look into this PR. This is my first. Thanks in advance!

@Ansh-dS
Copy link
Contributor

Ansh-dS commented Mar 13, 2025

haven't remove console.log()

@scuciatto scuciatto added this to the 7.8.0 milestone May 23, 2025
@Al2Tul2 Al2Tul2 modified the milestones: 7.8.0, 7.9.0 Jun 24, 2025
@scuciatto scuciatto modified the milestones: 7.9.0, 7.10.0 Jul 22, 2025
@scuciatto scuciatto modified the milestones: 7.10.0, 7.11.0 Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: Incorrect usersCount from response
4 participants