Skip to content

fix(pg): deprecate preparing Invalid Date values - #3730

Open
Hashim1999164 wants to merge 1 commit into
brianc:masterfrom
Hashim1999164:fix/invalid-date-prepare-value
Open

fix(pg): deprecate preparing Invalid Date values#3730
Hashim1999164 wants to merge 1 commit into
brianc:masterfrom
Hashim1999164:fix/invalid-date-prepare-value

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • Detect Invalid Date in prepareValue and emit a DeprecationWarning (pg@8 keeps current serialization; pg@9 will throw).
  • Add a unit regression test for the warning path.

Fixes #3318

Test plan

  • Unit test prepareValues: invalid date emits deprecation warning
  • Manual prepareValue(new Date(NaN)) shows deprecation and NaN string

Invalid Date currently serializes to a nonsensical NaN timestamp string.
Warn in pg@8 and plan to throw in pg@9, per brianc#3318.
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.

Do not serialize new Date(undefined) as "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"

1 participant