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

Client-side input validation #171

Closed
stewartadam opened this issue Aug 29, 2020 · 2 comments
Closed

Client-side input validation #171

stewartadam opened this issue Aug 29, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@stewartadam
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As of writing (v0.10.1) there doesn't appear to be input validation during web recipe import, possibly elsewhere. The quantity field in of an ingredient row, for example, accepts non-integer numbers when server-side validation enforces integer values only for that field.

In such a mismatch, the server creates a partial recipe entry (up through the ingredient row that contained the validation error) and presents an error to the user without much detail unless DEBUG=1.

Describe the solution you'd like
Client-side validation enforces similar input limitations to server-side validations, to prevent users from submitting recipes that fail to import/save.

@stewartadam stewartadam added the enhancement New feature or request label Aug 29, 2020
@vabene1111 vabene1111 added bug Something isn't working and removed enhancement New feature or request labels Aug 30, 2020
@vabene1111
Copy link
Collaborator

Interesting issue, thanks for reporting! I do not really care about client side validation as long as the server gives appropriate answers and does not create any partial database entries so i will probably stick to the server doing validation but the issues you describe are definitely bad and should be fixed!

Also the reason for no number validation being used on the input field is so that you can use both the , and the . as a decimal seperator and the server tries to match it to an integer.

@vabene1111
Copy link
Collaborator

The issue will be fixed in the next release and its also no longer possible for partial entries to get created as the whole function is now wrapped in a database transaction that gets rolled back if an error occurs. Errors do still break the client side but that on purpose so that it can be fixed asap if something occurs.

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

No branches or pull requests

2 participants