Skip to content

Don't clear async errors between validations#440

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

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

Conversation

@erikras
Copy link
Member

@erikras erikras commented Dec 6, 2021

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
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
Copy link
Member Author

erikras commented Dec 6, 2021

Released in v4.20.5.

@bertho-zero
Copy link
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