Skip to content

fix: reject impossible transcript calendar dates - #207

Open
Lordskid wants to merge 1 commit into
flop-labs:mainfrom
Lordskid:fix/reject-impossible-transcript-dates
Open

Lordskid wants to merge 1 commit into
flop-labs:mainfrom
Lordskid:fix/reject-impossible-transcript-dates

Conversation

@Lordskid

Copy link
Copy Markdown

What

Reject transcript timestamps containing impossible calendar dates before parsing them. Valid leap days, fractional seconds, and timezone offsets remain supported.

Why

JavaScript's Date.parse() normalizes impossible dates, such as February 31, into dates in the following month. This can cause transcript timestamps to disagree with the parsed instants used by deadline checks.

Closes #188

Checks

  • pnpm -r --include-workspace-root build
  • pnpm -r --include-workspace-root test
  • Golden vectors untouched
  • CHANGELOG.md has an [Unreleased] entry

Copy link
Copy Markdown

Thanks for addressing #188. Heads-up that #190, opened earlier, already implements the same calendar-date rejection in src/transcript.ts, with regression cases for invalid February/April dates, valid leap days, fractional seconds and offsets. Its exact-head fork CI passed the full build and 177 tests: https://github.com/maho0638/tclk/actions/runs/37065379276. The implementations differ in shape/error wording, but appear to close the same issue; only one should merge. Flagging the overlap so reviewers can compare them and select a single implementation rather than spending time resolving avoidable conflicts.

@Lordskid

Copy link
Copy Markdown
Author

Thanks for addressing #188. Heads-up that #190, opened earlier, already implements the same calendar-date rejection in src/transcript.ts, with regression cases for invalid February/April dates, valid leap days, fractional seconds and offsets. Its exact-head fork CI passed the full build and 177 tests: https://github.com/maho0638/tclk/actions/runs/37065379276. The implementations differ in shape/error wording, but appear to close the same issue; only one should merge. Flagging the overlap so reviewers can compare them and select a single implementation rather than spending time resolving avoidable conflicts.

Thanks for the heads-up and for reviewing the overlap. I wasn’t aware of PR #190 when I started working on issue #188.

My implementation includes regression tests for impossible February and April dates, plus a valid leap day. I understand that only one implementation should be merged, and I’m happy to defer to the maintainers on which solution is best.

This branch has not been deployed

No deployments
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.

transcript: impossible RFC3339 calendar dates normalize through Date.parse

2 participants