Repository navigation
Perf: Optimize member handling in collectives with a large number of members - #2518
Conversation
9fd8790 to
0f02d43
Compare
|
@mejo- heh, it seems like that topic is much more complex. I've updated the PR description and pushed more changes. Please, re-review |
0cc7584 to
66c9f24
Compare
7c4c736 to
ad68198
Compare
| } | ||
| this.circlesMembersPending[circleId] = true | ||
| try { | ||
| const response = await axios.get(generateOcsUrl(`apps/circles/circles/${circleId}/members?fullDetails=true&limit=${limit}`)) |
There was a problem hiding this comment.
fullDetails=true slowdowns endpoint by x4. And this needed only for detection is member is list current user or not
// CurrentMembers.vue
isCurrentUser() {
return (item) => {
return item.userId === this.currentUser
|| item.singleId === item.circle.initiator.singleId
}
},We can think about improving that in follow-up PR
There was a problem hiding this comment.
That sounds like a good idea. It should also reduce the usage of the local storage drastically so we can bring that back.
ad68198 to
d5639a7
Compare
|
@max-nextcloud please review and help me with Cypress tests 🙏 (if you have time for that) |
|
@Koc It's on my list. Can't promise anything unfortunately. |
3736d95 to
a834e30
Compare
…rge number of members Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
…rge number of members (try to fix tests) Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
a834e30 to
8bf8b71
Compare
|
@max-nextcloud @mejo- mates, I've fixed Cypress tests in the end of June as well and we have completely green pipeline. Any chance to merge this one? |
From what I can tell the requests were addressed.
📝 Summary
This is continuation of #2443.
I've generated 1200 users using
./occ user:addand assigned them to a single collective using./occ circles:members:add. Here are my findings:1. Members list endpoint works really slow
I had an attempt to implement lightweight API endpoint in circles module but stuck with it due to federated users. This is a really loong path which I'd prefer to avoid. Also keep in mind that we're reloading this members list every 1 minute due to background fetcher and endpoint latency goes up to 10s in our organization.
So, instead of that we're loading only 15 users for a landing page. And then re-loading all users once we toggle editor mode from preview to edit. This improves performance of BE without degradation of the users autocomplete functionality in the editor.
Feel the difference 😃

2. vDOMException: The quota has been exceeded
This happens because we store
circlesMembersin the local storage. I've changed it to a local variable. As an option - we can store same 15 users but this would add even more complexity.At the same time we're still store tons of keys like
nextcloud_per_bmV4dGNsb3Vk_user-has-avatar.adminbut this is a separate topic, let's handle it in the follow-up PRs.3. There is no skeleton loading in the member picker popup
We have bad UX as endpoint can respond up to 10s in our case. I've added it
4. Full list reloading for an every member change
Every member change like add/remove/change level causes full list reloading. As we already mentioned - this is slow operation. When we managing large circle it becomes a nightmare. So I've added in-place update to state instead of full re-fetching.
💭 Future improvements
From my PoV we should move users management into a single place, e.g. to Contacts module. Because right now we are doing more or less same things, see nextcloud/contacts#5330
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)🤖 AI (if applicable)