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

Syntax errors in conditional expressions only fail at run time #481

Open
lognaturel opened this issue Sep 6, 2019 · 2 comments
Open

Syntax errors in conditional expressions only fail at run time #481

lognaturel opened this issue Sep 6, 2019 · 2 comments

Comments

@lognaturel
Copy link
Member

lognaturel commented Sep 6, 2019

There is no static analysis performed to make sure expressions have the correct syntax. In general, this is fine because as soon as a user opens a form definition in Validate, Collect or any other JavaRosa client, the full form will be evaluated and an expression with bad syntax will be identified.

However, this is problematic in the case of expressions that involve nesting, particularly with conditional logic. Consider for example the expression if (/data/my_var = 'yes', fake-function('bad', 'bad'), 0). If no one actually tries yes as a value for my_var, the fact that fake-function isn't supported won't be detected until a real user tries to enter yes and hits a runtime exception.

See getodk/validate#60 and most likely #480 for examples of how this has affected real users.

@joeflack4
Copy link
Contributor

Hello all. I just found a screenshot that I can share with you of what the issue looks like when it appears on the phone, if it's of any help.

Screenshot_20190819-123600

@lognaturel
Copy link
Member Author

Thanks! That looks like what I would expect.

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