Skip to content

[Mailer][Postmark][Webhook] Accept different date formats #53829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

aleho
Copy link
Contributor

@aleho aleho commented Feb 7, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #53788
License MIT

Postmark webhooks sometimes use "plain" ISO 6801 format, sometimes including 7 digits microseconds.
We're currently seeing 2024-02-07T09:41:16.7048881Z for example.

As the PHP parameter only allows for 6 digits neither would parse without fallbacks.

@carsonbot carsonbot added this to the 6.4 milestone Feb 7, 2024
@carsonbot carsonbot changed the title [Mailer][Postmark][Webhook] Accept different date formats [Mailer][Webhook] [Postmark] Accept different date formats Feb 7, 2024
@aleho aleho changed the title [Mailer][Webhook] [Postmark] Accept different date formats [Mailer][Postmark][Webhook] Accept different date formats Feb 7, 2024
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for digging this.
Can you please as some test cases to cover this?

Postmark webhooks sometimes use "plain" ISO 6801 format, sometimes
including 7 digits microseconds. As the PHP parameter only allows for 6
digits neither would parse without fallbacks.

Fixes symfony#53788
@aleho aleho force-pushed the fix-postmark-webhook-dates branch from aa9e308 to 8af3d02 Compare February 8, 2024 17:33
@aleho
Copy link
Contributor Author

aleho commented Feb 8, 2024

@nicolas-grekas I replaced all the custom formats in the tests with PHP's "official" ISO 8601 format. I guess it's supposed to be compatible with the standard and if not, Postmark is sending broken webhooks anyway. Is that OK?

@nicolas-grekas
Copy link
Member

Thank you @aleho.

@nicolas-grekas nicolas-grekas merged commit adbe494 into symfony:6.4 Feb 9, 2024
@aleho aleho deleted the fix-postmark-webhook-dates branch February 9, 2024 09:40
This was referenced Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants