Repository navigation
fix(aggregator): refuse impossible calendar dates in validateStreamEvent - #5158
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fixes #5154 (queue task 8836).
validateStreamEventvalidated the event timestampatwithDate.parseonly.Date.parserolls day-overflow dates over instead of rejecting them, so2026-02-30T10:00:00Zwas accepted and stored verbatim while every consumer (retention prune, newest-first ordering) parsed it as 2026-03-02.Change: the
atgate now uses the sharedisIsoDateprimitive frompm-stack/aggregator/src/validate.ts— the same primitive the DNS register (#2199) and charges (#3458) boundaries use — instead ofDate.parse. Impossible dates (2026-02-30,2026-04-31T10:00:00Z,2026-13-01, non-leap2026-02-29) are refused at ingest, and on load they are treated as malformed by the existingisStreamEventpath. Real timestamps still validate: leap dates (2024-02-29T10:00:00Z), offsets (+02:00), fractional seconds, and date-only forms.Tests: new
validateStreamEvent refuses impossible calendar dates (#5154)case inpm-stack/aggregator/test/events.test.ts. Targeted run on the laptop:bun test test/events.test.ts test/orchestration.test.ts— 50 pass, 0 fail. (Localbunx tsc --noEmitin the fresh worktree fails on a missingbuntype-definition package, unrelated to this change; CI typecheck covers it.)The related
isSavedViewDate.parse-only site insrc/views.tsnamed in issue #5154 is deliberately left for a separate change, as the issue allows.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.