Fix Validation for Grace Values Outside Range 0-7 - #9044
Conversation
- 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>
|
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! |
|
👋 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:
We look forward to your contribution once you're assigned! 🚀 |
Summary
fix: reject grace values outside 0-7 with validation error
Changes
Fixes #1241