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.
Proposed Changes
This commit uses the length of the deduped users rather than the undeduped length in the users query. It ensures that the count is correctly displayed on the Users page.
Before
After
Why are these changes being made?
The list of users is already deduped, but the count is not. This creates a mismatch between the number of users returned in the list and the count.
I suspect it was an oversight in https://github.com/Automattic/wp-calypso/pull/50712/files#diff-d3b37aa7f029b8f881e02a9ea0d701be351599baeab1900624a99512954a6cceR43
I think the deduping should happen at the source: Related endpoint changes: Automattic/jetpack#28317 (comment)
Testing Instructions
/people/team/[YOUR_SITE]
/people/team/[YOUR_SITE]
and check that the "You have n team members" contains the correct count./people/team/[YOUR_SITE]
and check that the "You have n team members" contains the correct count. (Invites are not counted)4
again but give them a role of Editor or Author. Accept that invite./people/team/[YOUR_SITE]
and check that the "You have n team members" contains the correct count.Pre-merge Checklist