Repository navigation
fix(members): fetch up to 500 members and show correct total in sidebar - #1411
Open
swarnendusahu10-dotcom wants to merge 1 commit into
Open
swarnendusahu10-dotcom wants to merge 1 commit into
swarnendusahu10-dotcom wants to merge 1 commit into
Conversation
getChannelMembers() called /channels.members (and /groups.members) without a count param, so Rocket.Chat defaulted to returning 100 results. Rooms with more than 100 members were silently truncated. RoomMember.js displayed 'Showing N of N' using filteredMembers.length for both values, so the total was always the same as the visible count — never reflecting the actual room member count. Fixes: - Add count=500 to getChannelMembers() to fetch up to 500 members - Import useChannelStore in RoomMember.js - Use channelInfo.usersCount as the authoritative total in 'Showing X of Y' - Fallback to members.length when channelInfo not yet loaded Fixes RocketChat#1286
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR fix?
Closes #1286
Problem
Two related bugs:
getChannelMembers()had nocountparam, so Rocket.Chat defaulted toreturning only 100 members. Rooms with more than 100 members were silently
truncated — no warning, no indication. This also broke
@-mention autocompletefor any user beyond the first 100.
RoomMember.jsshowed"Showing N of N"usingfilteredMembers.lengthfor both values, so the total was always wrong — the actual room member
count (already stored in
channelInfo.usersCount) was never read.Fix
count=500togetChannelMembers()— raises the cap from 100 to 500,covering the vast majority of real-world rooms
RoomMember.jsnow readschannelInfo.usersCount(already in the Zustandstore, zero extra API calls) as the authoritative total, with a safe fallback
to
members.lengthif not yet loaded@-mention autocomplete benefits automatically — no separate change neededKnown limitation
This moves the hard cap from 100 → 500, not removes it. Rooms with 500+
members will still be partially truncated. Full lazy pagination (load-more on
scroll) would be the proper long-term solution but is a larger feature addition
outside the scope of this bug fix.
Files changed
packages/api/src/EmbeddedChatApi.ts—getChannelMembers()URLpackages/react/src/views/RoomMembers/RoomMember.js— "Showing X of Y" display