Skip to content

Feature/refresh#590

Open
AnishCoder2006 wants to merge 4 commits into
GitMetricsLab:mainfrom
AnishCoder2006:feature/refresh
Open

Feature/refresh#590
AnishCoder2006 wants to merge 4 commits into
GitMetricsLab:mainfrom
AnishCoder2006:feature/refresh

Conversation

@AnishCoder2006
Copy link
Copy Markdown

PR Title
Fix ActivityFeed polling to prevent GitHub API rate limit exhaustion

Summary
Closes: #475
Refactored ActivityFeed.tsx to use sustainable polling intervals and defensive state management, preventing unauthenticated GitHub API rate limit exhaustion and UI flicker during background refreshes.

Architecture Context
Public REST APIs protect their infrastructure by imposing strict request limits based on a client’s IP address. The unauthenticated GitHub API rate limit is capped at 60 requests per hour.

Failure Mechanism
Original ActivityFeed used a rapid 30‑second polling (setInterval(fetchEvents, 30000)).

Every background refresh cycle explicitly called setLoading(true).

Impact
Leaving the dashboard open for ~30 minutes exhausted the 60 unauthenticated requests, causing 403 Forbidden errors across the app.

Aggressive loading states caused constant UI flicker during polling.

Solution
Extended background polling interval from 30s → 120s (setInterval(() => fetchEvents(true), 120000)).

Added isMounted guard to prevent state updates after unmount.

Introduced hasLoadedOnce flag to suppress loading state during background refreshes.

Kept initial load showing loading, but background refreshes now happen quietly without interrupting the user.

Why
Prevents early rate limit depletion.

Stops aggressive UI flicker during background polling.

Makes refresh behavior safe during tab transitions/unmounts.

How to Test
Open the dashboard and leave it running for >30 minutes.

Verify that API requests remain under the 60/hour unauthenticated limit.

Confirm that background refreshes occur every 120s without UI flicker.

Switch tabs or unmount the component → no state update errors.

Acceptance Criteria
No 403 errors due to rate limit exhaustion.

Background polling runs every 120s.

UI remains stable without flicker.

Safe behavior during tab transitions/unmounts

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Warning

Review limit reached

@AnishCoder2006, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 52 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea9f1356-9bd0-4abd-a972-4a840dc59313

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae0ef6 and 1080697.

📒 Files selected for processing (5)
  • github_tracker
  • netlify.toml
  • public/_headers
  • public/_redirects
  • src/components/ActivityFeed.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for github-spy failed.

Name Link
🔨 Latest commit 1080697
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a17c42c2421e90008ff9a9c

@AnishCoder2006
Copy link
Copy Markdown
Author

3 succesful changes was made .Please accept my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub API Rate-Limit Exhaustion

1 participant