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

[EventDispatcher] Fix unknown priority #29822

Merged
merged 1 commit into from Feb 21, 2019

Conversation

Projects
None yet
4 participants
@ro0NL
Copy link
Contributor

commented Jan 8, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

Somehow, after #29411 the profiler actually shows the security firewall ContextListener.

This listener removes itself at call time, but at this point it's wrapped reference is already in the call stack; to be displayed in the profiler.

Because the wrapped listener lazily collects its priority - it asks it from the dispatcher - we get null; the listener was already removed.

This causes the profiler to render - by default:

image

This fixes it by always passing the expected priority at call time.

@ro0NL

This comment has been minimized.

Copy link
Contributor Author

commented Jan 8, 2019

The PR conflicts a bit with upstream, during added constructor hints. Let me know what to do, i wasnt necessarily aiming to deprecate not passing this new argument, nor do i want to add a new setter.

Also im not sure about applying all short array changes here&now, on 3.4

edit: dropped the constructor arg, but still conflicts :)

@ro0NL ro0NL force-pushed the ro0NL:event-prio branch from 56cee66 to 3e57fe1 Jan 8, 2019

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Jan 10, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

could you please rebase?

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Feb 20, 2019

rebase needed to retrigger the CI bots

@ro0NL ro0NL force-pushed the ro0NL:event-prio branch from 3e57fe1 to 9fb619a Feb 20, 2019

@ro0NL

This comment has been minimized.

Copy link
Contributor Author

commented Feb 20, 2019

@fabpot

fabpot approved these changes Feb 21, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Feb 21, 2019

Thank you @ro0NL.

@fabpot fabpot merged commit 9fb619a into symfony:3.4 Feb 21, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Feb 21, 2019

bug #29822 [EventDispatcher] Fix unknown priority (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[EventDispatcher] Fix unknown priority

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Somehow, after #29411 the profiler actually shows the security firewall `ContextListener`.

This listener removes itself at call time, but at this point it's wrapped reference is already in the call stack; to be displayed in the profiler.

Because the wrapped listener lazily collects its priority - it asks it from the dispatcher -  we get null; the listener was already removed.

This causes the profiler to render `-` by default:

![image](https://user-images.githubusercontent.com/1047696/50850320-d5c5ee80-1379-11e9-8516-0c6bc54512ce.png)

This fixes it by always passing the expected priority at call time.

Commits
-------

9fb619a [EventDispatcher] Fix unknown priority

@ro0NL ro0NL deleted the ro0NL:event-prio branch Feb 21, 2019

This was referenced Mar 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.