You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix Serde UTC deserialisation and remove column fields from Message::$meta_keys #614
Model\Message::$meta_keys includes expires_at and severity, which are dedicated columns. encode_meta() therefore writes {"date":"…","timezone_type":3,"timezone":"UTC"} into meta and duplicates severity. jsonSerialize() happens to override both afterwards, which is why this hasn't been caught.
Serde deserialisation of dates doesn't reliably round-trip as UTC. Every date assertion elsewhere depends on this.
Serde::maybe_deserialize_mysql_date() calls DateTime::createFromFormat() without a timezone, so dates are read in the PHP default timezone. WordPress sets that to UTC, but anything that changes it shifts every date. It also accepts dates like 2024-02-30, which PHP silently rolls over to March.
Message::$meta_keys includes expires_at, severity and channel_title, so encode_meta() writes them into the meta JSON.
Plan: read and write dates in UTC explicitly, remove the three keys from $meta_keys while keeping them in jsonSerialize(), drop the unused validate_message(), add tests/phpunit/tests/test-serde.php and update test-model-message.php. I'll open a PR shortly.
Activity
huzaifaalmesbah commentedon Oct 16, 2026
Hi @jonathanbossenger, I'd like to work on this one.
I've reproduced both parts:
Serde::maybe_deserialize_mysql_date()callsDateTime::createFromFormat()without a timezone, so dates are read in the PHP default timezone. WordPress sets that to UTC, but anything that changes it shifts every date. It also accepts dates like2024-02-30, which PHP silently rolls over to March.Message::$meta_keysincludesexpires_at,severityandchannel_title, soencode_meta()writes them into themetaJSON.Plan: read and write dates in UTC explicitly, remove the three keys from
$meta_keyswhile keeping them injsonSerialize(), drop the unusedvalidate_message(), addtests/phpunit/tests/test-serde.phpand updatetest-model-message.php. I'll open a PR shortly.Model: Handle dates in UTC in Serde and the message factory (WordPres…