feat: add cache-busting queryand X-cache-Status response headers#4155
feat: add cache-busting queryand X-cache-Status response headers#4155Vartika-l7 wants to merge 3 commits into
Conversation
|
@Vartika-l7 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
bc731d6 to
7274553
Compare
|
🚨 Hey @Vartika-l7, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
Aamod007
left a comment
There was a problem hiding this comment.
Summary
The PR cannot be approved because there is a reference error in the API route which breaks functionality.
Required Changes
Issue 1
- Problem: In �pp/api/stats/route.ts, the code attempts to call headers.set(...) but the headers variable is not instantiated or defined in that scope.
- Impact: Will throw a ReferenceError at runtime and cause the API endpoint to crash with a 500 error.
- Required Fix: Ensure that the response headers object is correctly created and returned as part of the NextResponse, rather than mutating an undefined headers object.
Aamod007
left a comment
There was a problem hiding this comment.
Summary
The PR cannot be approved because the CI tests or build are failing.
Required Changes
- Problem: The CI tests or build are failing.
- Impact: Breaks the continuous integration pipeline.
- Required Fix: Investigate the failures locally and ensure all tests pass in the CI environment before requesting another review.
Aamod007
left a comment
There was a problem hiding this comment.
Summary
The PR cannot be approved because the CI tests or build are failing.
Required Changes
- Problem: The CI tests or build are failing.
- Impact: Breaks the continuous integration pipeline.
- Required Fix: Investigate the failures locally and ensure all tests pass in the CI environment before requesting another review.
Aamod007
left a comment
There was a problem hiding this comment.
LGTM! I have analyzed the diff and verified that the implementation is correct. All required CI checks are passing (ignoring Vercel deployment failures). Approved!
|
Hi! Thanks for the review and approval. When I initially opened the PR, everything was working except for one small issue. While fixing that, I ran into a few related problems, so I'm currently working through those and will push the remaining fixes shortly. Thanks again for taking the time to review it! |
7274553 to
b923776
Compare
|
Hey! I went through the issues that were causing the CI failures and made the necessary fixes. While running the test suite locally, I noticed that I also looked into the comment regarding Additionally, I addressed the changes that were causing the CI pipeline to fail. |
Description
Fixes #4091
Added a ( ?bypassCache=true ) query parameter to all API routes so users can fetch fresh data without waiting for the 5-minute cache window.
Added an X-Cache-Status response header (BYPASS or HIT) to help debug cache behavior.
Also reduced the manual refresh cooldown from 5 minutes to 30 seconds
Pillar
Visual Preview
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.ADDTIONALLY ( Tests verified ) :
lib/github.test.ts — 143/143 pass
app/api/streak/route.test.ts + tests/ — all pass
app/api/stats/route.test.ts — all pass
app/api/github/route.test.ts — all pass
Streak sub-tests (grace, refresh, views) — all pass
services/github/refresh-policy.empty-fallback.test.ts — pass (updated for 30s cooldown)
The 3 pre-existing failures (commitpulse-logo, CommitClock, Heatmap) are unrelated to my work.