fix(audit): return 400 for invalid from/to dates and strict-parse limit - #378
Merged
davidmckayv merged 4 commits intoSep 5, 2026
Merged
Conversation
Ayush7614
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
September 5, 2026 10:09
davidmckayv
approved these changes
Sep 5, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Re-run after format fix (prior CI failure was a stale-run race on the pre-format sha). Current head passes format:check + full CI. Substance verified by composed build/tests + deep review.
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.
?from=not-a-date fed an Invalid Date into drizzle gt/lt with no try/catch in the route, surfacing a 500. parseInt also accepted '50abc' as 50 and '3.9' as 3.
Change: auditQueryFromUrl throws AuditQueryError on unparseable from/to (route maps to 400), and strict-parses limit (digits-only, else default 50, still clamped 1-100). Valid queries behave as before.
Verified: manual checks (limit 10/50abc/3.9, valid + invalid from/to); bun test server/tests/audit.test.ts + config.test.ts 94 pass.