8000 [Messenger] Fix default serializer not handling DateTime objects properly by barton-webwings · Pull Request #47702 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Fix default serializer not handling DateTime objects properly #47702

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

Conversation

barton-webwings
Copy link
Contributor
@barton-webwings barton-webwings commented Sep 27, 2022
Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets --
License MIT
Doc PR --

I was using messenger standalone and needed to send messages in JSON format. While trying to do so using the Serializer class, I noticed that DateTime objects (present for example in RedeliveryStamp) are not serialized properly.

I fixed it by adding the proper normalizer.

I encountered it in version 5.2, but it should be applicable from version 4.4.

Before:

before

After:

after

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

Oh no, it looks like you have made this PR towards a branch that is not maintained anymore. :/
Could you update the PR base branch to target one of these branches instead? 4.4, 5.4, 6.0, 6.1, 6.2.

Cheers!

Carsonbot

@barton-webwings barton-webwings changed the base branch from 4.3 to 4.4 September 27, 2022 10:56
@barton-webwings barton-webwings force-pushed the messenger-default-serializer-datetime branch 3 times, most recently from 7b26e95 to 84e1379 Compare September 27, 2022 11:06
@mtarld
Copy link
Contributor
mtarld commented Oct 4, 2022

Hey @barton-webwings,

Thanks for your PR! As you can see in the Symfony releases calendar, the 4.3 version isn't maintained anymore, can you please target 4.4 instead?

@chalasr chalasr added this to the 4.4 milestone Oct 4, 2022
@barton-webwings
Copy link
Contributor Author

Hello @mtarld,

yeah, the bot warned me about it too, so I rebased the branch onto symfony:4.4 and changed the target.

I am getting some weird failures in the tests though, looks like due to direct float comparison.

@chalasr
Copy link
Member
chalasr commented Oct 5, 2022

Don't worry about the failures, they are not related to your change.

@xabbuh
Copy link
Member
xabbuh commented Oct 5, 2022

If you can, you could rebase your changes onto the latest 4.4 branch which should make the CI pass again.

@barton-webwings barton-webwings force-pushed the messenger-default-serializer-datetime branch from 84e1379 to 302b147 Compare October 5, 2022 10:26
@barton-webwings barton-webwings force-pushed the messenger-default-serializer-datetime branch from 302b147 to 85c459c Compare October 5, 2022 10:28
@fabpot
Copy link
Member
fabpot commented Oct 9, 2022

Thank you @barton-webwings.

@fabpot fabpot merged commit 300408c into symfony:4.4 Oct 9, 2022
@barton-webwings barton-webwings deleted the messenger-default-serializer-datetime branch December 12, 2022 14:33
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.

6 participants
0