Repository navigation
fix(teams): always use populationInherited for population count - #5059
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
3e27201 to
bafc3f9
Compare
…pdate count on population change Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
bafc3f9 to
b59a6f0
Compare
|
rebased to fix CI, Does it need backport ? |
Thanks! Yes, I'll request the backports. |
|
/backport to stable8.3 |
|
@hamza221 This PR is the frontend counterpart of this one: nextcloud/circles#2300. On the backend side (nextcloud/circles), I’ve requested backports to stable32 and stable31. Given that, I think we can cancel the backport of this PR to stable7.3 and keep only backport for stable8.3. Looking at https://apps.nextcloud.com/apps/contacts, if we backport this to stable7.3 (used on nextcloud/server stable30), the Circles backend changes would not be included there, which could lead to frontend errors (e.g. trying to access a key that is not returned). The reverse is not an issue: the backend implementation is backward-compatible and preserves the existing behavior, so it won’t break the frontend on stable7.3. |
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)