Repository navigation
fix(form-core): ignore aborted async form-level validation results (continues #2350) - #2440
AlexRixten wants to merge 2 commits into
Conversation
FieldApi and FormGroupApi already drop in-flight async results after a newer run aborts them. FormApi was missing that check, so a slower previous validator could overwrite newer valid state.
🦋 Changeset detectedLatest commit: 120e211 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
🎯 Changes
Continues #2350 by @official-burak, which has been inactive since Aug 19 — all credit for the root-cause analysis, the fix, and the tests belongs there. This PR carries that work forward on current
mainso it can land.Fixes #2346
FieldApiandFormGroupApialready drop in-flight async validation after a newer run aborts the previousAbortController.FormApionly checked the signal before starting the validator, not after it resolved.That matters for form-level
onChangeAsyncvalidators that cannot observe the signal (including Standard Schema / Zod async refinements). A slower previous run can still apply its result and restore an error after a newer validation has already accepted the current value.The check is the same one those sibling APIs already use: if
controller.signal.abortedafter the validator settles, resolve without writingerrorMap.✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit