Skip to content

[HttpKernel] Forward _stateless attribute to inline rendered fragments #50198

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

Merged
merged 1 commit into from
May 2, 2023

Conversation

MatTheCat
Copy link
Contributor

@MatTheCat MatTheCat commented Apr 30, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets Prerequisite for #50037
License MIT
Doc PR N/A

For now inline rendered fragments have no mean of checking if the _stateless attribute has been set so they cannot adapt accordingly. This PR would allow them not to use the session if $request->attributes->getBoolean('_stateless') is true.

This could be used in ProfilerController’s searchBarAction eg.

@stof stof added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label May 2, 2023
@stof
Copy link
Member

stof commented May 2, 2023

could you add a test covering this behavior to prevent regressions ?

@MatTheCat MatTheCat force-pushed the stateless-fragments branch 2 times, most recently from 61389e3 to 725c105 Compare May 2, 2023 15:11
@MatTheCat
Copy link
Contributor Author

@stof done. I simplified the code as well.

@nicolas-grekas nicolas-grekas force-pushed the stateless-fragments branch from 725c105 to fae3825 Compare May 2, 2023 16:03
@nicolas-grekas
Copy link
Member

Thank you @MatTheCat.

@nicolas-grekas nicolas-grekas merged commit 5ea3bed into symfony:6.3 May 2, 2023
@MatTheCat MatTheCat deleted the stateless-fragments branch May 2, 2023 16:22
fabpot added a commit that referenced this pull request May 5, 2023
This PR was merged into the 6.3 branch.

Discussion
----------

Profiler respect stateless attribute

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #50037
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Now that #50198 forward `_stateless` attribute in fragments, this PR check this attribute and make profiler stateless when is required.

I don't know which tests I have to add because session is not checked. (I checked on reproducer and it's ok)

Commits
-------

7820776 [WebProfilerBundle] Profiler respect stateless attribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature HttpKernel ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants