HackClubRAIT / HackClubRAIT.github.io

Website for hackclub rait
https://hackclubrait.github.io/
MIT License
20 stars 56 forks source link

Bug in Contributers page #67

Closed Chaitalishetty closed 2 years ago

Chaitalishetty commented 2 years ago

Describe the bug In contributors page, the followers and following is not correct.

pratik1424 commented 2 years ago

I have fixed the bug for follower count, but GitHub API is giving "message": "Not Found" error for "users[i].following_url". For example consider this URL. I can open a PR for fixing follower count.

Chaitalishetty commented 2 years ago

@pratik1424 Assigning this issue to you. Happy Coding !

addisonhardley commented 2 years ago

@pratik1424 @Chaitalishetty, Apologies for the bug, the feature was implemented by me. The followers and following currently displays the length of the followers_url and following_url (strings) provided by the github api. In order to correctly display them, we'll need to make a request to each of the links and then get the length of the response data. Since, github api allows only 60 requests/hour for unauthenticated users, this would seriously hurt the application's performance and may even result in errors when contributors count go above 30 (2 requests per user, one for following, other for followers).

Workaround: Remove the contributor's followers and following count. I have tried that. It would look something like this:

image

If you like this concept, you can assign me this issue and I'll create a pull request (already coded). Otherwise, I encourage @pratik1424 to do the necessary. Cheers!

Chaitalishetty commented 2 years ago

@addisonhardley as you already contributed in the project is it okay with you if I assign this issue to @pratik1424 so he can make the necessary changes.

pratik1424 commented 2 years ago

@addisonhardley true, scraping data from each of the contributor's account is taking too much time and making the page unresponsive. @Chaitalishetty what should we do? We can just keep contributions and followers or go with @addisonhardley 's solution.

addisonhardley commented 2 years ago

@addisonhardley as you already contributed in the project is it okay with you if I assign this issue to @pratik1424 so he can make the necessary changes.

Yeah, I am totally fine with it.

Chaitalishetty commented 2 years ago

@pratik1424 you can keep only the number of contributions

pratik1424 commented 2 years ago

@pratik1424 @Chaitalishetty, Apologies for the bug, the feature was implemented by me. The followers and following currently displays the length of the followers_url and following_url (strings) provided by the github api. In order to correctly display them, we'll need to make a request to each of the links and then get the length of the response data. Since, github api allows only 60 requests/hour for unauthenticated users, this would seriously hurt the application's performance and may even result in errors when contributors count go above 30 (2 requests per user, one for following, other for followers).

Workaround: Remove the contributor's followers and following count. I have tried that. It would look something like this:

image

If you like this concept, you can assign me this issue and I'll create a pull request (already coded). Otherwise, I encourage @pratik1424 to do the necessary. Cheers!

@addisonhardley This design looks better, you can go ahead with that. (Don't worry about my PR, I have already got 4, so this was just for learning :P)

addisonhardley commented 2 years ago

@pratik1424 Thanks :D. @Chaitalishetty, Could you assign this issue to me? I'll create a PR after that.