-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.2.x] Webprofiler - Some called listeners are not shown #6686
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
Comments
Yes I can confirm this but in 2.2.0-RC3. I have an initial listener on kernel.request that is triggered and shown in the profiler. |
I could setup a basic project repo to demo this if it helps? |
A fork of the Symfony Standard Edition would definitely help. Thanks. |
No problem, will do that today and come back to you. |
Hey @fabpot See the diff as a comparison against the 2.2 branch here catchamonkey/symfony-standard@symfony:2.2...catchamonkey:listener_issue You can pull down, install the deps and run the demo page, app_dev.php/demo/hello/World then look at the events in the profiler, you will see the secondary one i created is in the Not Called Listeners section, but it is being called (uncomment the die within). |
Actually i've changed it so the secondary method logs an error when called. |
And one more thing, if you can give me a starting point as to where you think the issue may be, i'd be happy to have a look and see if I can solve it. |
@fabpot This is probably because the dispatcher being passed in the event is the inner dispatcher, not the wrapping one (it is always the issue when using composition and the inner object passes |
@stof is right and it was done on purpose. Not sure what to do here. |
Obviously it has knowledge of all the services tagged as kernel.event_listener, but the EventsDataCollector is only aware of the main dispatcher instance in terms of what it knows has happened to those events? |
I've used the sams approach in a long standing 2.0 project which doesn't have this issue. |
When in debug mode, Why don't we rename |
I did that to avoid too much overhead and I did not anticipated the possible issues. So, I guess we should always inject that debug event dispatcher (don't remember if there were any other reasons for not doing it). |
@fabpot What should be done
8000
is aliasing the debug dispatcher as |
For the issue @stof raised about the call to |
Any other thoughts on this? |
I have part of a fix over at #7673, but what @catchamonkey demonstrates is that when you use the The example happens to dispatch the second event that's missed from an event listener, but that is irrelevant. My fix would help there only if he used So what's the best practise to re-define/alias the service? |
Probably we need a decision in the first place whether we want to
And while we're at it, it is allowed to re- |
👍 we have the same issue, this is a little bit annoying because upgrading from 2.1 to 2.3 a lot of functional test fails :( thanks guys. |
This PR was merged into the 2.2 branch. Discussion ---------- [FrameworkBundle] made sure that the debug event dispatcher is used everywhere | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #6686, #7673 | License | MIT | Doc PR | n/a Commits ------- f65a526 [FrameworkBundle] made sure that the debug event dispatcher is used everywhere
And now I do remember why I haven't replaced the event dispatcher service with the traceable one. That's because the traceable event dispatcher needs the profiler, which creates a bunch of data collectors that need many services. The same goes for the twig service which needs a bunch of services for its extensions. But, as some of these deps are required by both the profiler and twig, we have some circular references. The easiest way to reproduce is the run the I'm going to revert the referenced PR for now and we are back to the drawing board. |
@fabpot should the traceable dispatcher really receive the full profiler ? This is the real issue IMO. IIRC, this was done to be able to track events triggered late in the process, by registering them manually in the profiler instead of relying on |
#9168 is another attempt to fix this issue. Unfortunately, as this is a rather large patch and a new interface for data collectors, it's going to be only applied on master. The regression from the previous patch does not exist as I have decoupled the traceable dispatcher from the profiler, but if someone can confirm that there are no other regression with other standard bundles, that would help us a lot. |
I have the same problems, referenced in the PR. |
@fabpot - I am having trouble with this now also within the context of Zikula and a module called Dizkus. The problem appeared in the last 10 days or so and was tested and working previous to that. Zikula uses an extended version of Events called hooks. The typehinting is breaking because we've expected
|
here's my full trace: https://gist.github.com/craigh/18943007017037559aa8#file-zhookissuetrace |
@craigh Your typehint should use the interface, not the implementation |
thank you @stof - I changed the typehints (you can see here: zikula/core#1372) and now I get a new error 😦 any ideas? |
surely, this is a Symfony error - even my IDE identifies |
@craigh It is not a Symfony bug but an IDE bug which does not take into account that closures are objects in PHP. |
In Symfony 2.2.0-BETA1, I've created a listener that listens to the
security.authentication.success
and it's perfectly triggered.But when I look at the
Events
panel in the profiler application, it's still listed in theNot Called Events
section of the panel.The text was updated successfully, but these errors were encountered: