-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Fix cloned TraceableStack not unstacking the stack independently #51675
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
Conversation
public function testClonedTraceableStackUnstacksIndependently() | ||
{ | ||
// import TraceableStack | ||
class_exists(TraceableMiddleware::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas, I added this test method to test if a clone can be unstacked independently. I noticed that the existing method testHandle()
in the same file does test TraceableStack
unstacking via the use of TraceableMiddleware
, but it doesn't test if a cloned version will unstack the stack independently, so I was thinking their could be a new test for that as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the class_exists check, why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, without it I get the following error:
Error: Class 'Symfony\Component\Messenger\Middleware\TraceableStack' not found
To fix the error, I tried to import TraceableStack
at the top of the test file, but I can't get it to work because it's located within TraceableMiddleware.php
instead of within its own file.
b80d0c2
to
b91bdc6
Compare
Thank you @krciga22. |
Fixed a bug with cloned
TraceableStack
not unstacking the stack independently from the original due to the __clone() method not yet being implemented. Clones ofStackMiddleware
currently unstack the stack independently, but notTraceableStack
.