Skip to content
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

[RemoteEvent] Fix date parsing remote event payload converter #54712

Merged
merged 1 commit into from Apr 27, 2024

Conversation

alexandre-daubois
Copy link
Contributor

Q A
Branch? 7.1
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

AppVeyor fails on some date expectation:

There was 1 failure:
1) Symfony\Component\Mailer\Bridge\Resend\Tests\Webhook\ResendRequestParserTest::testParse with data set "C:\projects\symfony\src\Symfony\Component\Mailer\Bridge\Resend\Tests\Webhook/Fixtures\sent.json" ('{\n    "created_at": "2024-04..."\n}\n', Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent Object (...))
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
     'name' => 'received'
     'id' => '172c41ce-ba6d-4281-8a7a-541faa725748'
     'payload' => Array (...)
-    'date' => 2024-04-08T09:43:09.500000-0700
+    'date' => 2024-04-08T09:43:09.500000+0000
     'email' => 'test@example.com'
     'metadata' => Array (...)
     'tags' => Array ()
     'reason' => ''
 )
C:\projects\symfony\src\Symfony\Component\Webhook\Test\AbstractRequestParserTestCase.php:32

Indeed, this can happen depending on your configuration because the timezone is not set when creating fixtures, which leads to a difference, as shown here: https://3v4l.org/iFBMq.

Defining the timezone in the parsing should solve this flaky test.

@xabbuh
Copy link
Member

xabbuh commented Apr 24, 2024

Are we still missing some fixtures? I still see failures in the related AppVeyor job. :)

@alexandre-daubois alexandre-daubois force-pushed the fix-date-parsing branch 2 times, most recently from 3f99189 to 78ae568 Compare April 24, 2024 09:48
@alexandre-daubois
Copy link
Contributor Author

That's really weird, I'm investigating. 🕵️

@alexandre-daubois alexandre-daubois changed the title [RemoteEvent] Fix date parsing in test fixtures [Mailer] Fix date parsing remote event payload converter Apr 24, 2024
@alexandre-daubois
Copy link
Contributor Author

Got it. Fixing this bug actually highlighted another one in the remote event payload conversion. That's fixed as well 🙂

@carsonbot carsonbot changed the title [Mailer] Fix date parsing remote event payload converter [RemoteEvent] Fix date parsing remote event payload converter Apr 26, 2024
@fabpot
Copy link
Member

fabpot commented Apr 27, 2024

Thank you @alexandre-daubois.

@fabpot fabpot merged commit c834064 into symfony:7.1 Apr 27, 2024
8 of 10 checks passed
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.

None yet

4 participants