Skip to content

Fix Validation for Grace Values Outside Range 0-7 - #9044

Closed
VedantMadane wants to merge 1 commit into
JhaSourav07:mainfrom
VedantMadane:fix/issue-1241
Closed

Fix Validation for Grace Values Outside Range 0-7#9044
VedantMadane wants to merge 1 commit into
JhaSourav07:mainfrom
VedantMadane:fix/issue-1241

Conversation

@VedantMadane

Copy link
Copy Markdown

Summary

fix: reject grace values outside 0-7 with validation error

Changes

  • Schema previously clamped grace>7 with Math.min and returned 200.
  • Now add a Zod issue so out-of-range grace fails validation (400) instead of silent coercion.

Fixes #1241

- Schema previously clamped grace>7 with Math.min and returned 200.
- Now add a Zod issue so out-of-range grace fails validation (400) instead of silent coercion.

Fixes JhaSourav07#1241

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@retenta-bot

retenta-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

This PR addresses the issue of grace values being clamped silently, which could lead to unexpected behavior. It aligns with previous decisions to validate and clamp the grace parameter in the calculateStreak function to ensure consistent behavior and adherence to the API contract. Thank you for your contribution!

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @VedantMadane! Thanks for your interest in contributing to CommitPulse! 🙏

Unfortunately, this PR has been automatically closed because you are not assigned to the linked issue #1241 — [Bug]: grace param accepts values above 7 silently — should return 400.

To avoid this in the future, please follow these steps:

  1. Claim the issue — Comment /claim on #1241 if you are the issue author, or ask a maintainer to /assign you.
  2. Wait for confirmation — The bot will confirm your assignment with a ✅ reply.
  3. Then open your PR — Link the issue with Fixes #1241 in your description.

💡 You can be assigned to up to 5 open issues at a time. Check your current assignments before claiming a new one.

We look forward to your contribution once you're assigned! 🚀

@github-actions github-actions Bot closed this Aug 24, 2026
@retenta-bot retenta-bot Bot changed the title fix: reject grace values outside 0-7 with validation error Fix Validation for Grace Values Outside Range 0-7 Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: grace param accepts values above 7 silently — should return 400

1 participant