[GSSoC'26] fix(batch): return unknown for malformed expiry dates#1803
Conversation
Report for Issue #1799Bug
Changes
Files Changed
Verification
@RatLoopz Please review! |
bfb7abd to
1ca4072
Compare
|
Hey @vipul674, your PR description says u added 5 tests to Could u plz commit and push that missing test file to this branch? Once the tests are in, I'll happily merge this! |
null expiry_date, malformed date, expired, near-expiry, and future date. Closes RatLoopz#1799
|
Hey @dipexplorer! The missing test file @RatLoopz, CI should re-run now that the test file is present.
|
|
🎉 Congratulations @vipul674! Your Pull Request "[GSSoC'26] fix(batch): return unknown for malformed expiry dates" has been successfully merged by @dipexplorer. Thank you for your valuable contribution to SahiDawa! 🇮🇳 Follow us on LinkedIn: https://www.linkedin.com/company/ratloopz/ to get shoutout |
Description
getExpiryStatus()did not check forNaNafternew Date(expiryDate), causing malformed expiry dates (e.g. "N/A", "invalid") to fall through to"green"instead of"unknown".isNaN(expiry.getTime())guard that returns"unknown"for unparseable dates.Files Changed
apps/api/src/routes/batch.ts: Added NaN check after date parsing ingetExpiryStatusapps/api/tests/batch.test.ts: Added 5 tests covering null, malformed, expired, near-expiry, and future expiry datesType of Change
Difficulty & Label Request
Assessed difficulty:
level1Please apply the matching difficulty label so the contribution is scored correctly for GSSoC '26.
If applicable, please also apply
gssoc:approvedafter review.Testing & Verification
Commands run:
Result:
Known Limitations
GSSoC 2026 Compliance
This contribution was prepared with AI assistance and manually reviewed before submission.
Closes #1799