Skip to content

Expose form session unlocking for dynamic collections - #46

Merged
josbeir merged 2 commits into
josbeir:mainfrom
LordSimal:feature/unlock-form-collections
Oct 18, 2026
Merged

josbeir merged 2 commits into
josbeir:mainfrom
LordSimal:feature/unlock-form-collections

Conversation

@LordSimal

Copy link
Copy Markdown
Contributor

Forms with JavaScript-managed collections can submit rows that were added or removed after rendering. Applications currently need custom session and lifecycle subclasses to allow these changes through CakePHP form protection.

Add FormSession::unlock(string $path): void for explicitly unlocking a field or collection while its form is open. The lifecycle enforces the open-session requirement and delegates to the existing protection service. Other fields and form sessions retain their protection.

Includes a documented collection example and regression tests for changed or omitted rows, tampering with other fields, session isolation, invalid lifecycle phases, and forms without protection.

Validation:

  • composer validate --strict
  • composer check: 810 tests, 3,199 assertions; analysis, lint, Rector, and formatting pass
  • composer test-coverage: 100% line coverage (2,514/2,514); greater-than-90% gate passes
  • npm run docs:build
  • Alfred integration against the local fork: 36 form-helper tests, 186 assertions

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (64a47db) to head (1f09bb3).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #46   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      1088      1090    +2     
===========================================
  Files            120       120           
  Lines           2935      2942    +7     
===========================================
+ Hits            2935      2942    +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Queue successfully rendered submissions until token generation so explicit collection unlocks apply to existing and future controls. Build tokens from a cloned protector to support unlocking after a failed closing template.

Cover root and nested collections, hidden values, protected siblings, and closing retries. Document that unlock() may be called before or after rendering controls.
@josbeir

josbeir commented Oct 18, 2026

Copy link
Copy Markdown
Owner

@codex review this

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T18:58:33.173587Z 1f09bb3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 1f09bb3f68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@josbeir
josbeir merged commit c23f6d2 into josbeir:main Oct 18, 2026
4 checks passed
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.

3 participants