Repository navigation
fix(core): reject duplicate multiselect selections in validateAnswer (#707) - #709
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🤖 Agent note · parked
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: |
Fixes #707
validateField's multiselect branch counted raw array length forminItems/maxItemsand checked closed-option membership per entry, so a repeated option counted as multiple distinct selections:["a","a"]satisfiedminItems: 2, and["a","a"]was rejected bymaxItems: 1as "too many" despite naming one distinct selection — contradicting the distinct-selections premise of the #704 create-time check.Chosen rule (one stated rule, applied consistently): duplicate entries are rejected with
Duplicate selection for form field: <key>, checked after the required/empty check and beforeminItems,maxItems, and closed-option membership, so every multiselect answer path sees the same rule. Answers without duplicates behave exactly as before, includingwheninclusion semantics.Tests: new regression test in
packages/core/test/form.test.tscovers["a","a"]againstminItems: 2(options[a,b]),["x","x","x"]against a custom multiselect withminItems: 3,["a","a"]againstmaxItems: 1, duplicates with no bounds, and no-duplicate controls. Verification is via CI on this PR (no builds on the sandbox).Need help on this PR? Tag
@codesmith-botwith what you need.