fix(stats): report correct cache status for cold requests#6228
Conversation
Check if cache had data before fetch using contributionsCache.has(). Now correctly reports: - MISS for cold requests (no cache entry) - HIT for requests served from cache - MISS for bypass requests Fixes JhaSourav07#5503
|
@vipul674 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@JhaSourav07 Ready for review. All tests passing. |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
left a comment
There was a problem hiding this comment.
Fixing the cache reporting for cold requests is a nice quality-of-life improvement for debugging API performance. Adding the mock for contributionsCache.has in app/api/stats/route.empty-fallback.test.ts keeps the test suite robust. Approved!
|
🎉 Congratulations @vipul674! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
Related Issue
Fixes #5503
Type of Change
Description
Check if cache had data before fetch using
contributionsCache.has(). Now correctly reports:MISSfor cold requests (no cache entry)HITfor requests served from cacheMISSfor bypass requestsTesting
contributionsCacheandcacheKeyin test filesChecklist