fix(form-core): clear errorSourceMap.onMount alongside errorMap.onMount - #2362
fix(form-core): clear errorSourceMap.onMount alongside errorMap.onMount#2362alliasgher wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesForm error clearing
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change clears stale field-error source metadata alongside the error itself and adds regression coverage for both supported sources; no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
🎯 Changes
Fixes #2294.
FormApi.setFieldValueclearserrorMap.onMounton the field's meta but leaveserrorSourceMap.onMountuntouched, sofield.state.meta.errorSourceMap.onMountkeeps reporting a source ('field'or'form') for an error that no longer exists inerrorMap. Every other field-meta write inFormApi.tsupdates the two maps together, so this reads as an omission rather than intent.This adds the matching
errorSourceMapupdate inside the samesetFieldMetacall, and two regression tests inFormApi.spec.tscovering the'field'source (field-levelonMountvalidator) and the'form'source (form-levelonMountvalidator emitting a field error).alphais not affected:errorSourceMapdoes not appear in any package on that branch, so there is nothing to port to v2.Note that #2245 edits the same block for an unrelated reason. There is no functional overlap; happy to rebase if it lands first.
✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit