community-toolbox
community-toolbox copied to clipboard
Contributors section gets stuck with a spinner, no images
Please describe the problem (or idea)
What happened just before the problem occurred? Or what problem could this idea solve?
What did you expect to see that you didn't?
Sometimes (esp after reloading the page a few times) we get just a spinner for this section:
The JS console shows we've gone over our API limit:
failed to load resource: the server responded with a status of 403 ()
https://code.publiclab.org/#r=all
Analysis
I bet we have some data already cached and we're just hitting an error on trying to fetch new data. We could try logging out what contributors we /already/ have to test this out.
Solution
Let's try to fall back on the existing set of saved contributors if the new requests fail.
- The first step is probably to look for where the code is for the request
- and then to add an extra "on fail" handler!
- we could also show an error message that something like
You've hit GitHub's API rate limit for fetching new data. Old data shown instead; try again in 5-10 minutes!
Any help appreciated!!!
The rate limiting is also observed on the local environment which makes it hard to test the website in the first place. @jywarren I think we should start with investigating the number of requests that are being made per page refresh and look for the possible optimisations.
Also what are your thoughts on using the Authenticated request token for fetching the data since that has a limit of about 5000 requests per hour
as oppose to 60 requests per hour
for the un-authenticated one...
We've unfortunately discussed the idea of a token before, and we really want this to be able to run purely client-side. What we could do is think of a way to add a token for developer usage, to make debugging easier.
But we can also start with (3) above and just display an appropriate message when we get such an error back, which would do a lot to make the issue more transparent to the user.
Then we could go back in and see what's going wrong and try to add an "onFail" fallback to display the prior cached data.
Hi, @jywarren How are you? I would like to work on this.
Thank you, that would be wonderful!
On Wed, Jun 9, 2021, 6:19 PM Yogesh Sharma @.***> wrote:
Hi, @jywarren https://github.com/jywarren How are you? I would like to work on this.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/community-toolbox/issues/456#issuecomment-858139325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6J3JNLJB4MZJ5VOYCOTTR7SIPANCNFSM43GAJLPA .
Hi @jywarren and @TildaDares can I also assist with this?
@prius2055 we'd love help with it. Would you like any help getting started?