feat: cache bypass rate limiter#4870
Open
pari-dubey1 wants to merge 2 commits into
Open
Conversation
) ## Description This PR adds a comprehensive unit test suite for the ThemeSwitch component, covering the custom useThemeToggle hook, theme class persistence, prefers-reduced-motion fallback logic, startViewTransition integration, and ThemeToggleButton rendering/interaction. Fixes JhaSourav07#3343 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (Utility/Unit Tests only) ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally. - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors. - [x] My commits follow the Conventional Commits format. - [x] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have started the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard. - [ ] (Recommended) I joined the CommitPulse Discord community.
Contributor
|
@JhaSourav07 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
🚨 Hey @pari-dubey1, 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3708
Introduces production-grade security and architectural resilience updates to the streak tracking routes:
middleware.ts): Tightens the?refresh=trueand?bypassCache=truequery parameter validation gates to use a strict sliding limit of 3 requests per 10 minutes (600,000ms) per client IP address. This effectively neutralizes automated cache-exhaustion vectors while maintaining zero modification fallout to underlying utility configurations.route.ts): Implements a precise native exception translation boundary wrapper aroundIntl.DateTimeFormat. This securely intercepts nativeRangeErrorbugs triggered by un-enumed strings and down-flows them gracefully as structured 400 Bad Request SVG response error cards, preventing unhandled 500 server crashes.no-explicit-any).Pillar
Visual Preview
(N/A: System middle-tier security routing updates and automated logic test coverage expansions).
Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors (including strict TypeScript and ESLint type lint restrictions).feat(security): ...).npm run test) seamlessly.