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

GitAuto: A performance of a page (/settings/integrations/jira) is too slow. #139

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gitauto-for-dev[bot]
Copy link

Resolves #133

Why the bug occurs

The /api/jira/get-projects and /api/github/get-installed-repos endpoints are being called multiple times unnecessarily. This results in redundant network requests, which significantly slows down the performance of the /settings/integrations/jira page.

How to reproduce

  1. Navigate to the /settings/integrations/jira page.
  2. Open the browser's network console.
  3. Observe that the /api/jira/get-projects endpoint is called twice in quick succession.
  4. Similarly, notice that the /api/github/get-installed-repos endpoint is invoked twice simultaneously.

How to fix

  1. Identify Redundant Calls: Review the components and hooks responsible for fetching data on the /settings/integrations/jira page to identify where the duplicate API calls are initiated.
  2. Optimize Data Fetching Logic:
    • Ensure that data-fetching functions are not called multiple times due to re-renders or improper dependency arrays in hooks like useEffect.
    • Consolidate API calls where possible to prevent simultaneous requests.
  3. Implement Caching: Utilize caching strategies to store and reuse fetched data, reducing the need for repeated API requests.
  4. Debounce or Throttle Requests: If applicable, implement debounce or throttle mechanisms to limit the frequency of API calls triggered by user interactions.
  5. Refactor Code: Update the relevant components and utilities in the app, components, or utils directories to incorporate the above optimizations.

By addressing the redundant API calls and optimizing the data fetching strategy, the performance of the /settings/integrations/jira page will be significantly improved.

Test these changes locally

git checkout -b gitauto-wes/issue-133-20241214-151359
git pull origin gitauto-wes/issue-133-20241214-151359

Copy link

vercel bot commented Dec 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitauto-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2024 6:18am

Copy link

gitauto.ai%2F

Before (main) After (this branch)

Copy link

gitauto.ai%2Fblog

Before (main) After (this branch)

Copy link

gitauto.ai%2Fsettings%2Fintegrations%2Fjira

Before (main) After (this branch)

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

Successfully merging this pull request may close these issues.

0 participants