-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove all unbounded API calls from frontend #520
Comments
Starting to enumerate, we can create separate tickets for these if needed:
Looking through, we actually have a LOT of instances where we make calls with a high There's cases like the call for "Active Personnel": https://github.com/IFRCGo/go-frontend/blob/develop/src/root/actions/index.js#L576 that need to fetch all items to display in a single chart - all these cases I think we should just handle in the same way we did CSV pagination. I think then the only one that I'm really concerned about is the fetching of Appeals like https://github.com/IFRCGo/go-frontend/blob/develop/src/root/actions/index.js#L232 - I can't see a good reason why we need to fetch ALL appeals from the backend. We need to dig more into that and see if we can swap out the logic there, perhaps by doing some aggregation on the backend. For the rest, I would advocate finding a good pattern to just moving all these instances to doing pagination managed by the frontend. Also, @frozenhelium, could you just comment on https://github.com/IFRCGo/go-frontend/blob/develop/src/root/actions/index.js#L70 |
Would you mind to review @batpad, if these still need to be resolved? Thanks. |
There are still a few places on the frontend where we make unbounded API calls (i.e. where we set the
limit
parameter to the API to a really high number to ensure we fetch "all" results") instead of paginating through API responses and fetching a sane amount, say 100, elements at a time.This is a blocker to us removing support for high
limit
values on the API - ideally, we would lock-down the API to not allow more than, say, 200 items in a single request.We need to:
limit
restriction on the API.I can start enumerating places where we are making unbounded calls on the frontend.
cc @frozenhelium @tovari @szabozoltan69
The text was updated successfully, but these errors were encountered: