publiclab / community-toolbox

Tools to understand and welcome people into a contributor community
https://code.publiclab.org
MIT License
142 stars 196 forks source link

Contributors section gets stuck with a spinner, no images #456

Open jywarren opened 3 years ago

jywarren commented 3 years ago

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:

image

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.

  1. The first step is probably to look for where the code is for the request
  2. and then to add an extra "on fail" handler!
  3. 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!!!

waridrox commented 3 years ago

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...

Screenshot 2021-05-03 at 10 40 12 PM_censored

jywarren commented 3 years ago

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.

YogeshSharma01 commented 3 years ago

Hi, @jywarren How are you? I would like to work on this.

jywarren commented 3 years ago

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 .

prius2055 commented 2 years ago

Hi @jywarren and @TildaDares can I also assist with this?

jywarren commented 2 years ago

@prius2055 we'd love help with it. Would you like any help getting started?