Skip to content
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

Rate limits impede browsing of the web-app when not logged in or logged in as user without admin/researcher privileges #447

Closed
timcowlishaw opened this issue Oct 26, 2023 · 3 comments · Fixed by #454
Assignees
Labels

Comments

@timcowlishaw
Copy link
Contributor

Mentioned on fablabbcn/smartcitizen-api#166 - When i am browsing the webapp while not logged in as a researcher or admin (o sea, logged in as an unprivileged user or not logged in at all), requests to the API periodically return 429 (due to rate limiting) and data on the page is not loaded.

Screenshot 2023-10-26 at 08 31 02
@timcowlishaw
Copy link
Contributor Author

timcowlishaw commented Oct 26, 2023

Discussed with @oscgonfer - after further investigation this only happens on user pages with a large number of kits, eg @pral2a :

sc_dev=# select users.username, count(devices.id) from users left join devices on users.id = devices.owner_id group by users.username order by count(devices.id) desc limit 10;
       username        | count
-----------------------+-------
 john                  |  1312
 team                  |  1264
 pral2a                |   492
 AIRLAB-ISGlobal       |   274
 Unibo                 |   162
 Battirob              |    60
 natamyk               |    40
 AIRLAB_ISGlobal       |    32
 IAAC-Cristian_Rizzuti |    31
 vico                  |    28

... as it makes a request for each kit. However this is unnecessary, as the kits data already arrives in the /v0/users/x api request! @oscgonfer to change so that it uses the data that's already there, and we should be fine :-)

(#443 would also fix this, but would still be making unnecessary requests)

@timcowlishaw timcowlishaw transferred this issue from fablabbcn/smartcitizen-api Oct 26, 2023
@pral2a
Copy link
Member

pral2a commented Oct 26, 2023

See #443 (comment) Thanks!

@oscgonfer
Copy link
Contributor

#454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants