chiefwigms / picobrew_pico

MIT License
149 stars 63 forks source link

Clientside Form Input Validation #332

Closed tmack8001 closed 2 years ago

tmack8001 commented 2 years ago

Many users have been getting "server communication error" messages cause they use strange or semi-strange characters in the name of their brewing recipes ("#", "@", "'", etc).

I'm not 100% certain what characters the devices support in parsing recipe name and step name, but this initial validation will limit to known working characters at least and prevent new recipes to be created with special characters.

@chiefwigms let me know what you think. Since we aren't using HTML submit buttons to submit the form and handling it as AJAX I couldn't get native browser validation to work correctly for pattern matching so just built out a quick 'n' dirty validation(form) function... and copied it 2 times 🙁 (ha!)

tmack8001 commented 2 years ago

I added in socketio client upgrade here to remove those pesky warnings (due to server and client incompatibilities as documented by socketio community) we keep polluting the logs with. I'm fine to also remove it and rely on the eventual merging of https://github.com/chiefwigms/picobrew_pico/tree/3rd_party_updates_02-20-2022 to resolve that too 🤷‍♂️