Skip to content

Fix test since last Symfony Release #2043

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

Conversation

jewome62
Copy link
Contributor

@jewome62 jewome62 commented Jun 25, 2018

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no
Fixed tickets
License MIT

Fail since 4.1.1 : for this commi : symfony/symfony@146e01c

The test don't work for PHP 7.0 and Symfony before 3 month ago. ( because NO_AUTO_CACHE_CONTROL_HEADER is implemented on March 2018)
I don't know if this is a bug which need to be fix on Symfony

@jewome62 jewome62 force-pushed the feature/fix-headers-override branch from 12ec35c to 415237d Compare June 25, 2018 23:29
@jewome62 jewome62 mentioned this pull request Jun 25, 2018
@@ -72,5 +73,7 @@ public function onKernelResponse(FilterResponseEvent $event)
if (null !== $this->public) {
$this->public ? $response->setPublic() : $response->setPrivate();
}

$response->headers->set(SessionListener::NO_AUTO_CACHE_CONTROL_HEADER, '');
Copy link
Member

Choose a reason for hiding this comment

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

It's almost good, just add an isset check before using the constant.

@teohhanhui
Copy link
Contributor

Uhh, you beat me to it. 😂

@soyuka soyuka mentioned this pull request Jun 26, 2018
@soyuka
Copy link
Member

soyuka commented Jun 26, 2018

I don't get why php 7 is failing... Locally the same behat test is successful.

@jewome62
Copy link
Contributor Author

jewome62 commented Jun 26, 2018 via email

@teohhanhui
Copy link
Contributor

As I've discussed with @jewome62, there's no good fix for this now. So let's wait for this to be sorted out in Symfony.

@dunglas
Copy link
Member

dunglas commented Jun 26, 2018

There is a good fix (for our test suite at least). The problem belongs here: https://github.com/api-platform/core/blob/master/tests/Fixtures/app/AppKernel.php#L117

When routes are secured, Symfony starts a session, and when a session is started, the cache is disabled by default. It looks like a sensitive default to me. We need to do 2 different things:

@teohhanhui
Copy link
Contributor

I'm inclined to think disabling access control falls into the "not a real fix" category.

@dunglas
Copy link
Member

dunglas commented Jun 26, 2018

Why? It would be more correct on our side (the resources served by our test app are public and don't vary depending of the logged in user, so the security must be disabled).

@teohhanhui
Copy link
Contributor

Well, yes, it's okay for our case. But it's still bad for other apps, including apps using API Platform. Something needs to be done in Symfony.

@teohhanhui
Copy link
Contributor

@teohhanhui
Copy link
Contributor

symfony/symfony#27714

@dunglas
Copy link
Member

dunglas commented Jun 26, 2018

Let's fix our test suite then. Symfony bugs must be fixed on the SF repo.

@soyuka
Copy link
Member

soyuka commented Jun 26, 2018

Let's fix our test suite then. Symfony bugs must be fixed on the SF repo.

We can't :D.

@teohhanhui
Copy link
Contributor

Indeed we can't. We just have to skip that test for now.

@soyuka
Copy link
Member

soyuka commented Jun 28, 2018

thanks for the investigation @jewome62 ! Lucky for us @dunglas fixed it in symfony and we're going to temporary use the http foundation dev branch while waiting for it!

@soyuka soyuka closed this Jun 28, 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.

4 participants