Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger] Proper message decoding error handling#50043
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
94409d1 to5a01ab9CompareUh oh!
There was an error while loading.Please reload this page.
72a5cb3 to08b0850Comparealex-dev commentedApr 24, 2023
6f0f923 to796da17Compare60068ef tod3f1e14Compared3f1e14 to67fb47cCompareismail1432 commentedNov 9, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hello@alex-dev, |
alex-dev commentedNov 9, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I could not justify spending more time on this to update it. Seeing Symfony had little interest in this fix, my company chose to implement a solution inside the transport layer. It is hacked, but the right behavior is guaranteed. |
B-Galati commentedNov 10, 2023
@alex-dev any chance you could share your solution? |
alex-dev commentedNov 10, 2023
We just reimplemented the transport and made rejection a no-op. There are a few annoying caveats.
Other alternative would be to reimplement the worker and associated commands (what this PR more or less does). |
Uh oh!
There was an error while loading.Please reload this page.
Problem
Handling deserialization in transports prevents actual error handling from running... And depending on transports, can even drop messages. While envelope and stamps deserialization failures may be actual error warranting undefined behavior, message denormalization failures is merely an application concern. Symfony should never drop messages that are broken by the application.
Solution
Reusing some part of#39622:
PhpSerializerandSerializerdo not throw error in message deserializationPhpSerializerMessageDecodingFailedStampinWorkerAbstractFailedMessagesCommandBC breaks
Messenger\Transport\Serialization\Serializer::__construct()first arguments goes from?SerializerInterface $serializer = nulltoDecoderInterface&DenormalizerInterface&SerializerInterface $serializerMessenger\Transport\Serialization\Serializer::create()still return a default constructed instance