fix(teams): always use populationInherited for population count #5059
+48
−11
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.
Summary
Fixes team population counts to show values consistently across UI.
Changes
populationInheritedinstead of alternating betweenpopulation(on page load) and member list length (when clicking on a team)Before
before.webm
After
after.webm
Known Issue
Race condition flow
LocalController::membersAdd()->MemberService::addMembers()MemberService::addMembers()triggersFederatedEventwhich runs asynchronouslyupdatePopulation()completed or not)updateCirclesPopulationCount()updatePopulation()did not complete yet)With this approach, sometimes users might need to reload the page to see correct counts, specifically when adding multiple members at once or when updating a team that's also nested in other teams. This happens because
getCircles()is called on the frontend beforeupdatePopulation()in the backend has actually finished executing.Checklist
3. to review, feature component)stable32)