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

Insufficient warnings when non-numeric float_value entered for data #48

Open
connorcoley opened this issue Apr 18, 2021 · 2 comments
Open
Assignees

Comments

@connorcoley
Copy link
Contributor

When the data field is set to a string, e.g., "asdf", and numeric Data is selected using the radio buttons, the message will not be loaded properly and the error is that data requires one of {value, bytes_value, url}. It would be better to describe that the input was non-numeric but a numeric field was entered, however, this must occur on the JS side not in Python validations

@skearnes skearnes transferred this issue from open-reaction-database/ord-editor May 30, 2022
@miori-nd miori-nd self-assigned this Feb 2, 2024
@miori-nd
Copy link
Collaborator

Hi @connorcoley , could you describe how you replicated this issue in the interface? Was this encountered while searching, or elsewhere in the application?

@connorcoley
Copy link
Contributor Author

This was in the graphical editor when contributing data. It's a rather weird edge case.

  1. Starting from a completely empty new reaction, add a component to input 1 and add a feature of type text with data/value "text_data". Saving this reaction and reloading the page shows that the message was saved properly.

  2. Starting from a completely empty new reaction, add a component to input 1 and add a feature of type number with data/value "5". Saving this reaction and reloading the page shows that the message was saved properly.

  3. Starting from a completely empty new reaction, add a component to input 1 and add a feature of type number with data/value "text_data". Saving this reaction and reloading the page shows that the message was not saved properly, and it will revert to a completely empty message (because no other fields are defined; if other fields were defined, only this 'feature' would be removed)

It's been a while, but IIRC the issue for this silent failure is that the attempted parsing of the data field to a number happens in JS and isn't passed through to Python during validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants