My home: All events slow to load in large organizations #2430
Labels
🐜 bug
Something isn't working
🐬 Medium
Just a nice sized issue.
🛑 potentially blocked
Potentially blocked by prerequisites (double check or ask someone, as it may have changed)
Description
The new Activist portal prototype (introduced in #2425) has a tab for "all events", which retrieves all future events for all organizations that the user is connected to. There is no Zetkin API for doing this in one request, so all organizations need to be queried separately. We have implemented this using the
getAllEvents
RPC, meaning that the web app frontend asks the web app backend for all events, and the web app backend makes multiple requests to the Zetkin API – one to retrieve a list of the user's organizations and then one per organization.Some users are connected to lots of organizations. National-level admins in large organizations will likely be connected to hundreds of organizations, but even regional-level admins can easily have 20-50 organizations, resulting in as many (+1) requests.
Steps to reproduce
testadmin@example.com
Expected Behaviour
The frontend should make a single API request to get all events, and the backend should then make as few requests as possible to the Zetkin API. The page should reasonably take at most a few seconds to load.
Actual Behaviour
The frontend makes a single API request to get all events, but the backend makes one for each organization in the tree. In the dev environment this does not take very long, but for a real user in a large production organization it can easily take 30 seconds or more.
Screenshots (if you have any)
None
Proposed solution
There is a Zetkin API for retrieving all events in an organization including all of it's sub-organizations recursively using the
?recursive
flag. This means, in theory, that we could limit the number of requests by only retrieving events from organizations at the highest level we have access to.I haven't tried whether this works, so it might also be the case that this requires changes to the Zetkin API.
The text was updated successfully, but these errors were encountered: