Skip to content

[Mime] Make RawMessage::message nullable in the constructor #53674

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

Closed
wants to merge 3 commits into from

Conversation

hunhejj
Copy link

@hunhejj hunhejj commented Jan 29, 2024

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

The RawMessage::message is nullable. However the parameter passed to the constructor is not allowed to be null.

@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 7.1 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

@hunhejj hunhejj changed the title Make RawMessage::message nullable in the constructor [MIME] Make RawMessage::message nullable in the constructor Jan 29, 2024
@hunhejj hunhejj changed the title [MIME] Make RawMessage::message nullable in the constructor [Mime] Make RawMessage::message nullable in the constructor Jan 29, 2024
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jan 29, 2024

Can you please add a test case that reproduces the issue you're seeing in the linked issue?

@hunhejj hunhejj changed the base branch from 6.4 to 6.3 January 29, 2024 15:56
@hunhejj
Copy link
Author

hunhejj commented Jan 29, 2024

Done @nicolas-grekas. I reused an existing test as the previous extractor didn't make too much sense anyway because there was no PHPDoc in the Email entity.

FYI I rebased the fix on 6.3 as it affects that as well.

@nicolas-grekas
Copy link
Member

Did that trigger the failure?

@hunhejj
Copy link
Author

hunhejj commented Jan 29, 2024

I tried to add a dedicated minimal test that shows my issue. The pipelines are failing but at least it gives an idea. Any ideas how we should proceed on this? I am new to contributing to Symfony, hence I feel a bit lost.

@hunhejj
Copy link
Author

hunhejj commented Jan 30, 2024

Thanks for pointing that out @smnandre. I rebased it on 6.4 again as originally.

There the underlying message property is null by default, so the serializing shouldn't be an issue. Also on 6.4 it is clear what the constructor type is supposed to align with.

I guess I still need to rework the new test, at least rename it more meaningfully, this was just a quick approach to showcase my issue.

What do you think @nicolas-grekas ?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jan 30, 2024

I dug the issue a bit and I submitted #53678 instead: the property shouldn't accept null in the first place, and the serializer shouldn't generate null messages.
Thanks for submitting!

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.

4 participants