-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Description
Description
LocaleListener sets _locale parameter to RequestContext on kernel.request (16 priority), but there's no code that resets this value for long-running applications
| $this->router?->getContext()->setParameter('_locale', $request->getLocale()); |
In our case, we found a side-effect for our long-running application in our own kernel.request listener (35 priority), that checks RequestContext - for the first request, there was no _locale parameter, but for the second - there is _locale parameter with value from previous request
The first idea that came to me was to implement kernel.reset tag (\Symfony\Contracts\Service\ResetInterface) for the \Symfony\Component\HttpKernel\EventListener\LocaleListener, which would reset _locale parameter just before processing the next request to avoid side effects for long-running apps
Example
No response