Skip to content

馃悰 key forms by name, reset them between requests - #32

Merged
garak merged 1 commit into
mainfrom
fix-form-key
Sep 26, 2026
Merged

garak merged 1 commit into
mainfrom
fix-form-key

Conversation

@garak

@garak garak commented Sep 26, 2026

Copy link
Copy Markdown
Member

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@garak
garak merged commit d28b5cf into main Sep 26, 2026
8 checks passed
@garak
garak deleted the fix-form-key branch September 26, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants