Skip to content

Don't clear async errors between validations#440

Merged
erikras merged 2 commits into
mainfrom
fix-async-error-reset-bug
Dec 6, 2021
Merged

Don't clear async errors between validations#440
erikras merged 2 commits into
mainfrom
fix-async-error-reset-bug

Conversation

@erikras

@erikras erikras commented Dec 6, 2021

Copy link
Copy Markdown
Member

Bug demonstrated here:

Edit beautiful-glitter-5mxo4

With this change, we remember the previous async errors, and only clear them when the async validation has returned.

@erikras erikras self-assigned this Dec 6, 2021
errors.username = "Username taken";
}
sleep(delay);
await sleep(delay);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Major oopsie! 🤦‍♂️

@erikras
erikras merged commit 3c3029f into main Dec 6, 2021
@erikras
erikras deleted the fix-async-error-reset-bug branch December 6, 2021 10:39
@erikras

erikras commented Dec 6, 2021

Copy link
Copy Markdown
Member Author

Released in v4.20.5.

@bertho-zero

Copy link
Copy Markdown
Contributor

Errors are still lost when mixing synchronous/asynchronous and record-level/field-level validation:

https://codesandbox.io/s/loving-ramanujan-b954o9

Test with test in firstName field

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants