Namit2111 / bible-verse-finder

https://bible-verse-finder.vercel.app
GNU General Public License v3.0
23 stars 31 forks source link

bug: Enhance GitHub API Fetching Performance for Repo Stats #59

Closed JustinhSE closed 3 days ago

JustinhSE commented 2 weeks ago

Overview

We've identified a performance issue with our application's interaction with the GitHub API, specifically when fetching repository statistics. The current implementation is not retrieving data in a timely manner, which negatively impacts user experience and potentially affects our application's overall performance. This enhancement aims to optimize our API calls to github.com for repo stats, ensuring faster and more efficient data retrieval.

Tasks

d-beloved commented 1 week ago

@JustinhSE assign this to me pls

d-beloved commented 3 days ago

With the current approach to getting the repo data, if one of the promises fails, the function returns without resolving the remaining promises.

The new approach will make sure that all of the promises are settled before the response is sent to the component. A fallback number (1) is provided in case of promise rejection.

Also, a new approach to rendering the component is being explored where a call to GitHub API is made only once within a session, subsequent rendering of the page within the session will be fetched from the browser session.

These improvements will ensure that the data is always shown, improving the UX of the app and reducing the number of quota usage allowed by GitHub API.

cc: @JustinhSE @Namit2111