Skip to content

Add SessionListener::onFinishRequest method to be inline with Symfony 3.4.12 #466

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

Closed
wants to merge 2 commits into from

Conversation

emodric
Copy link
Contributor

@emodric emodric commented Jun 26, 2018

Fixes #465

Same issue is probably happening on master, so needs to be forward ported.

@XWB
Copy link
Member

XWB commented Jun 26, 2018

Wouldn't it be easier to extend AbstractSessionListener and remove the getSubscribedEvents method?

@emodric
Copy link
Contributor Author

emodric commented Jun 26, 2018

@XWB That wouldn't prevent the original Symfony event listener to set the response to private, one already extending the abstract listener.

@andrerom
Copy link
Contributor

andrerom commented Jun 26, 2018

+1, but it does not avoid this happening again the future..

Should we add a __call() instead with the if check here?? /cc @dbu @Toflar
Maybe throw something if inner does not have what is called for.

@Toflar
Copy link
Contributor

Toflar commented Jun 26, 2018

I don't think this would reduce the risk of something like this happening. Quite the opposite, I think it could even cause potential errors to remain undiscovered. __call() would blindly forward to the decorated service but potentially it should do something different 😄

@andrerom
Copy link
Contributor

__call() would blindly forward to the decorated service but potentially it should do something different 😄

Well it can check which methods BaseSessionListener::getSubscribedEvents() hints about and only forward those. But yeah, I'm not saying that as a solution is pretty, just that we have a potential recurring fatal problem here.

@andrerom
Copy link
Contributor

andrerom commented Jun 26, 2018

So maybe we go ahead with this as is for now, you have my +1 so if @Toflar is +1 as well it's up to you @dbu (or other maintainers like @ddeboer)

Copy link
Contributor

@Toflar Toflar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests need to be fixed :)

@@ -47,6 +47,28 @@ public function testOnKernelRequestRemainsUntouched()
$listener->onKernelRequest($event);
}

public function testOnFinishRequestRemainsUntouched()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test should be skipped if the method does not exist in the core session listener. See https://travis-ci.org/FriendsOfSymfony/FOSHttpCacheBundle/jobs/396800434

Copy link
Contributor Author

@emodric emodric Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Toflar Done, however, PHP 5.4 and 5.6 builds still fail due to OOM errors.

Copy link
Contributor

@Toflar Toflar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @dbu, failing tests are unrelated and due to memory (thank you PHP 7 for giving us better memory efficiency). Thanks @emodric for the PR <3

@emodric
Copy link
Contributor Author

emodric commented Jun 27, 2018

Thank you @Toflar and @andrerom for review!

@dbu
Copy link
Contributor

dbu commented Jun 28, 2018

I changed the lowest build to 2.8.0 in other projects, to reduce the possibility space. Could be done here too.

Github doey not allow me to merge on the phone when tests fail. @ddeboer could your merge this and tag a patch release? Otherwise i can try to do it tonight.

@dbu
Copy link
Contributor

dbu commented Jun 29, 2018

merged in #472

@dbu dbu closed this Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants