馃悰 key forms by name, reset them between requests - #32
Merged
Merged
Conversation
Forms were keyed by name + session id. On a request with no session yet the id is empty in saveFilter() and set once filter() reads the session, so getFormView() missed the saved form and rendered an empty FormType. - Key forms by filter name only. - Implement ResetInterface and tag kernel.reset, so forms don't leak across requests in long-running processes. That was the reason for the session id, and it also kept growing $forms per session.
There was a problem hiding this comment.
Copilot review overview
馃煝 Approval recommended
All reviewed changes are covered by the final assessment with no unresolved blocking issues.
Review effort: Lite
Findings: None
What changed in this PR
Fixes form caching when sessions start during a request and prevents cached forms from leaking between long-running requests.
Changes:
- Key forms by filter name.
- Add reset support and register
kernel.reset. - Add regression tests and the required dependency.
| File | Description |
|---|---|
tests/鈥婩ilterTest.php |
Tests session initialization and form resetting. |
src/鈥婩ilter.php |
Updates form caching and reset behavior. |
config/鈥媠ervices.php |
Registers the reset hook. |
composer.json |
Adds the service contracts dependency. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forms were keyed by name + session ID. On a request with no session yet, the ID is empty in saveFilter() and set once filter() reads the session, so getFormView() missed the saved form and rendered an empty FormType.
kernel.reset, so forms don't leak across requests in long-running processes. That was the reason for the session ID, and it also kept growing $forms per session.