Skip to content

fix(profile): use shared cache and rate-limit handling for contributor search (#447) - #455

Open
sumitsingh-cyber wants to merge 1 commit into
AOSSIE-Org:mainfrom
sumitsingh-cyber:fix/447-contributor-profile-cache-rate-limit
Open

sumitsingh-cyber wants to merge 1 commit into
AOSSIE-Org:mainfrom
sumitsingh-cyber:fix/447-contributor-profile-cache-rate-limit

Conversation

@sumitsingh-cyber

Copy link
Copy Markdown
Contributor

Addressed Issues

Closes #447

Summary of Changes

  • Shared Cache Integration: Replaced the un-cached local fetchAllPages in ContributorProfilePage.jsx with a new exported fetchSearchAllPages utility in src/services/github.js that routes all search requests through fetchWithCache.
  • Search Pagination with IndexedDB Caching: Implemented fetchSearchAllPages to fetch and cache GitHub Search API pages under canonical query URLs, eliminating redundant Search API calls when navigating to previously viewed contributor profiles.
  • Rate-Limit & Abort Handling: Leveraged shared rate-limit handling in fetchWithCache (HTTP 429 detection, rate-limit header checks, and rate-limit-update event dispatching) and added opts.signal support to allow clean request aborting.
  • Unit Test Coverage: Added tests in src/services/github.cacheKey.test.js validating zero-fetch cache hits on repeated searches, multi-page pagination, AbortSignal handling, and rate limit error handling.

Verification

  • npx vitest run src/services/github.cacheKey.test.js passes (19/19 tests).
  • npm run build succeeds cleanly.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b396d1b and 2858db8.

Files selected for processing: 3

  • src/pages/ContributorProfilePage.jsx
  • src/services/github.cacheKey.test.js
  • src/services/github.js
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added bug Something isn't working frontend Frontend changes javascript JavaScript/TypeScript changes tests Test changes size/M 51-200 lines changed external-contributor External contributor labels Nov 14, 2026
@gitcordapp

gitcordapp Bot commented Nov 14, 2026

Copy link
Copy Markdown

Link your account with Gitcord

Thanks for opening this PR, @sumitsingh-cyber!

To receive Discord notifications and contributor tracking for this organization:

  1. Join Discord: https://discord.gg/hjUhu33uAn
  2. In Discord, run /link sumitsingh-cyber
  3. Paste the verification code into your GitHub bio (or a public gist)
  4. Click Verify in Discord (or run /verify-link sumitsingh-cyber)

Once linked, Gitcord can notify you about reviews, merges, and more.

— Posted by Gitcord

This branch has not been deployed

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

Labels

bug Something isn't working external-contributor External contributor frontend Frontend changes javascript JavaScript/TypeScript changes size/M 51-200 lines changed tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Contributor profile bypasses the shared cache and rate-limit handling

1 participant