Skip to content

feat: PWA reliability, Advanced Cache & GitHub API Resilience (Phases 1-3)#6099

Closed
saidai-bhuvanesh wants to merge 1 commit into
JhaSourav07:mainfrom
saidai-bhuvanesh:feature/api-resilience-pwa
Closed

feat: PWA reliability, Advanced Cache & GitHub API Resilience (Phases 1-3)#6099
saidai-bhuvanesh wants to merge 1 commit into
JhaSourav07:mainfrom
saidai-bhuvanesh:feature/api-resilience-pwa

Conversation

@saidai-bhuvanesh

Copy link
Copy Markdown

Pull Request: PWA Reliability, Advanced Cache & API Resilience (Phases 1-3)

This PR implements PWA reliability enhancements, advanced caching capabilities, and robust error-recovery mechanisms for the GitHub API integrations.

Phase 1: PWA Reliability & Offline Fallback

  • Added a branded offline fallback UI in app/offline/page.tsx (OfflineFallback component).
  • Configured the service worker (app/sw.ts) to cache the /offline fallback page during installation.
  • Updated the service worker fetch handler to gracefully serve the cached /offline fallback page on navigation failure.
  • Implemented corresponding tests in tests/pwa/offline-page.test.tsx.

Phase 2: Advanced Cache Management

  • Created versioned cache envelopes (CacheEnvelope) in lib/cache.ts to invalidate structures on schema upgrades.
  • Added regex pattern-based cache invalidation (invalidatePattern) to selectively purge cache entries.
  • Implemented Stale-While-Revalidate (SWR) logic in DistributedCache to optimize user response speed by returning stale cached data while updating in the background.
  • Added comprehensive cache tests in tests/cache-advanced.test.ts.

Phase 3: GitHub API Failure Recovery

  • Added jittered exponential backoff retries (getJitteredBackoff) to handle transient rate limits or outages without overloading GitHub.
  • Added intelligent error classification (shouldFallbackOnError) to distinguish transient errors from fatal logic/auth exceptions.
  • Implemented stale-cache and placeholder mock-data fallbacks in fetchUserProfile, fetchUserRepos, and fetchGitHubContributions.
  • Added the isOfflineFallback flag to return data so the UI can notify the user of potentially outdated information.
  • Wrote integration tests in tests/github-recovery.test.ts.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @saidai-bhuvanesh! Thanks for your contribution! 🎉

Unfortunately, this PR has been automatically closed because it is not linked to any open issue.

To resolve this, please do the following:

  1. Link a valid open issue by editing your PR description to include a closing keyword (e.g., Fixes #<issue-number>).
  2. Reopen this PR once the link is added.

💡 You can link multiple issues if needed (e.g. Fixes #12, Closes #34).
If you're working on something that doesn't have an issue yet, please open one first and then link it here.

We look forward to reviewing your PR once an issue is linked! 🚀

@github-actions github-actions Bot closed this Jun 20, 2026
@github-actions github-actions Bot added the type:feature New features, additions, or enhancements label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant