fix: seed enterprise sso form with defined defaults to avoid controlled warnings (#2095)#2120
Open
larryro wants to merge 2 commits into
Open
fix: seed enterprise sso form with defined defaults to avoid controlled warnings (#2095)#2120larryro wants to merge 2 commits into
larryro wants to merge 2 commits into
Conversation
Collaborator
Author
Desk Review — #2095 (uncontrolled→controlled warnings on Enterprise SSO form)Verdict: READY TO MERGE. CI: All checks green ( Tests run locally (once): What the fix does
Why it's correct (verified across all branches)
Non-blocking observations (optional, do not gate merge)
The related "protocol-switch validation gap [08]" is correctly out of scope here. |
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.
Summary
Fixes #2095 — the Enterprise SSO settings form logged five React "changing from uncontrolled to controlled" warnings on load (2× Select, 3× Switch).
Root cause
EnterpriseSsoForm'sdatauseMemo returnsundefinedwhile the connection config is loading, anduseFormEditorpassed that straight to RHF'sdefaultValues. The controlledSelect/Switchinputs therefore mounted withvalue/checked=undefined(uncontrolled), then flipped to controlled oncedataresolved and the form reset.Fix
useFormEditorgains an optionaldefaultValuesargument used purely for RHF's initialdefaultValues(read once at mount).datastays the loading sentinel, soisLoading/ dirty-suppression / the remote-update reset logic are unchanged.EnterpriseSsoFormpasses a fully-definedEMPTY_FORM_DATA(empty strings for text/Selects, booleans for Switches) so every control is controlled from the first render.Verification
bunx tsc --noEmit(platform): clean.bunx oxlint --type-awareon touched files: 0 warnings, 0 errors.oxfmt --check: clean.use-form-editor10/10 (added a regression test asserting defined defaults while loading) and existingenterprise-ssosuite 8/8.