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

[Debug][BC Break] Fixed deserialization of FlattenException by the Serializer component #33630

Closed
wants to merge 2 commits into from

Conversation

skalpa
Copy link
Contributor

@skalpa skalpa commented Sep 18, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #32719
License MIT

As spotted in #32719, the Serializer component is unable to deserialize some FlattenException instances, which breaks the messenger component when used with the symfony serializer.

While this can't be fixed in FlattenException without breaking BC, as the main/sole purpose of this class is to be serialization friendly, I thought it was a real issue.

Also, it should only break classes that extend FlattenException and I couldn't find a single project on Github that does this, nor imagine why anyone would want to (actually, I believe this class should have been marked final).

Here are all the issues I identified, and how they are fixed by this PR:

  • getHeaders can return null or array, but setHeaders had an array type-hint: I removed the type hint
  • getPrevious can return null or self, but setPrevious had a self type-hint: I removed the type-hint
  • setTrace required 3 arguments, and added a new frame to the trace: the file and line arguments are now optional, and I try to detect whether the passed trace has already been processed or not. This may not be the best thing to do IMHO, but an attempt to limit the BC break to subclasses and ensure usage of the class doesn't get broken.

Note: The same issues affect the FlattenException class of the new ErrorRenderer component, but I will submit an new issue to discuss the best solution here, as I would also like to discuss #32873 and propose an alternate solution to #32473.

@skalpa
Copy link
Contributor Author

skalpa commented Sep 18, 2019

As I don't like the BC, even though you could consider it fixes an important problem in the class, I tried to find other fixes for #32719 (comment).

If one of them seems more acceptable, I'll just close this and work on the alternate solution.

@skalpa
Copy link
Contributor Author

skalpa commented Sep 19, 2019

As I found a better solution that maintains BC to the linked issue, I'm closing this.
I'll work on a new PR ASAP.

@skalpa skalpa closed this Sep 19, 2019
@skalpa skalpa deleted the fix-serialize-debug-flatten branch September 19, 2019 01:18
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

2 participants