Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent validation results #144

Closed
System-Glitch opened this issue May 18, 2021 · 1 comment · Fixed by #145
Closed

Inconsistent validation results #144

System-Glitch opened this issue May 18, 2021 · 1 comment · Fixed by #145
Assignees
Labels
bug Something isn't working

Comments

@System-Glitch
Copy link
Member

System-Glitch commented May 18, 2021

Bug report

Version: v3.8.0
Environment: Ubuntu 20.04, Go 1.16
Reproduces: rarely

Because validation.Rules is a map, iteration order is not guaranteed, meaning that rules that rely on a certain order of validation (such as dates before/after) and where conversion is needed will randomly not pass even if the request is valid.

Potential fix: pre-process sorted list of keys by checking presence of field comparison rules

@System-Glitch System-Glitch added the bug Something isn't working label May 18, 2021
@System-Glitch System-Glitch self-assigned this May 18, 2021
@System-Glitch
Copy link
Member Author

Work started on the bug/validation-order branch.

@System-Glitch System-Glitch linked a pull request May 20, 2021 that will close this issue
@System-Glitch System-Glitch mentioned this issue May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant