Skip to content

fix: validate asynchronous array children - #95

Merged
simonguo merged 2 commits into
masterfrom
fix/array-async-validation
Oct 24, 2026
Merged

simonguo merged 2 commits into
masterfrom
fix/array-async-validation

Conversation

@simonguo

@simonguo simonguo commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

ArrayType.of() currently invokes child check() methods during checkAsync(), so async child rules can be skipped and an invalid array can be reported as valid. Dispatch structural array rules through child async checks for scalar arrays, tuples, shaped objects and nested arrays, including scalar entries already supported by nested-array schemas.

Preserve indexed field paths, nested error results and priority/required guards. Wrap each child call so a later synchronous checker throw does not detach an earlier rejection. Retain synchronous rule/message ordering within the new array traversal while preserving the existing factory-before-rule order of direct async field checks.

Validation: the 33-case regression fixture has 25 failures and eight passes on the original source. The candidate passes all 207 tests on Node 16.20.2, 18.20.8, 20.20.2 and 22.22.3; lint and CJS/ESM builds pass on all four, with byte-identical emitted files. An independent private tarball consumer passes all 627 Form/Table cases in both Chromium and Firefox and the RSuite TypeScript check. That consumer removes three old synthetic array-validation workarounds from test setup while retaining their ownership, cleanup and callback assertions; the corresponding fixture migration is required when RSuite adopts the future release.

Package version remains 2.4.3. Release preparation and RSuite adoption follow separately.

Copilot AI balanced review requested due to automatic review settings October 24, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@simonguo
simonguo merged commit 61112a4 into master Oct 24, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants