Repository navigation
fix: preserve submission callback rejections without a reason - #13967
Merged
bluebill1049 merged 2 commits intoOct 31, 2026
Merged
bluebill1049 merged 2 commits into
bluebill1049 merged 2 commits into
Conversation
Harjodhsingh200757
approved these changes
Oct 31, 2026
bluebill1049
approved these changes
Oct 31, 2026
bluebill1049
approved these changes
Oct 31, 2026
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.
Proposed Changes
handleSubmit(() => Promise.reject())()currently fulfills and setsisSubmitSuccessfultotrue. The callback failed, but its rejection reason isundefined, so the truthiness checks treat it as a successful submission.Track whether
onValidfailed separately from its error value. Rethrow the original reason and keepisSubmitSuccessfulfalse for synchronous throws and rejected promises withundefined,null,false,0or an empty string. Keep the existing submitted state and submit count behavior.Added ten regression cases using the real form hook. This is separate from #13905's validation and
onInvalidexception handling. No new dependencies or public API changes. No linked issue.Type of change
Checklist:
Validation on Node 22.23.4 and pnpm 11.28.10: 130 suites, 1,800 tests and 26 snapshots pass. Both type checks, builds, export checks, API Extractor and changed-file lint/format checks pass. Full lint has no errors and 572 existing warnings; API Extractor retains its TypeScript-version advisory. All 90 Chromium browser tests pass in the final full run. Reverting only the implementation makes all ten added cases fail; restoring it passes all 50 submit tests. The normal pre-commit checks pass.
Prepared with AI assistance (Codex and Instinct); the final two-file diff and validation evidence were reviewed. The local results apply to commit
5731b3a, based on8eef3e0; current master3f1257cmerges cleanly, but the combined tree was not separately retested locally.