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] 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 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
| publicfunctiontestClonedTraceableStackUnstacksIndependently() | ||
| { | ||
| // 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 methodtestHandle() in the same file does testTraceableStack unstacking via the use ofTraceableMiddleware, 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 importTraceableStack at the top of the test file, but I can't get it to work because it's located withinTraceableMiddleware.php instead of within its own file.
b80d0c2 tob91bdc6Comparenicolas-grekas commentedSep 20, 2023
Thank you@krciga22. |
Fixed a bug with cloned
TraceableStacknot unstacking the stack independently from the original due to the __clone() method not yet being implemented. Clones ofStackMiddlewarecurrently unstack the stack independently, but notTraceableStack.