Repository navigation
fix: validate asynchronous rules selected by when - #97
Merged
Merged
Conversation
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.
StringType().when(() => StringType().addAsyncRule(async () => false, 'Invalid')).checkAsync('value')currently reports success without invoking the selected asynchronous rule. The same skipped validation occurs in model/field checks and can hide selected rule rejections.Register separate synchronous and asynchronous callbacks for the existing conditional priority rule. Synchronous checks retain the original
.check()path; asynchronous checks await the selected type's.checkAsync(), including arrays, shaped objects and nested conditions. Preserve the existing rule-before-message order for synchronous selected rules. Conditions and selected rules are evaluated once per check.Add 20 regression/compatibility cases for pending validation, model branch selection/reselection, field arguments, recursive error shapes, regular/priority rejection and throw identity, message factories, required/empty values, outer rule ordering and synchronous behavior. The original implementation passes five controls and fails 15; the candidate passes all 227 runtime tests, both module builds, full source ESLint and strict public-declaration fixtures on Node 16.20.2, 18.20.8, 20.20.2 and 22.22.3. All 42 public declaration files remain byte-identical to the merged type fix.
RSuite integration: four new Form controls fail against the published 2.4.3 provider. With the exact 154-file private candidate tarball in an independently installed dependency tree, Chromium and Firefox each pass all 617 cases across 50 files in
src/Form/test, including error rendering, selected-rule rejection/throw identity and subsequent recovery. Full RSuite source type-check also passes. Three obsolete array test workaround registrations and one obsolete expected-type-error comment are removed only in that private consumer; existing assertions/deadlines and RSuite manifests/lockfile remain unchanged. The private candidate's runtime dependency requirements match the registry provider.No dependency, supported-runtime floor or package-version change. This is an unreleased source fix; the existing v2.4.3 tag and npm package remain unchanged. Its first hosted run
40065614926passed all four Node jobs, each with 227 runtime tests and the strict declaration fixture. All four actual Coveralls uploads were verified against synthetic mergec13f368d907be0a64753c5890d5874c7d46e0316; coverage is 95.5010% (+0.005 percentage points). Snyk passes and there are no unresolved inline review threads. The exact-head CodeSandbox preview has an actually empty API log and is covered by the existing user-authorized exception after all project gates pass. The preview is the only pending check being waived.