Skip to content

Fix incorrect user count in getUsersOfRoom (includes deactivated users) #38014

@Alok-2005

Description

@Alok-2005

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:

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions