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

Seed to randomize should not require an integer #49

Open
eyelidlessness opened this issue Feb 28, 2024 · 0 comments · May be fixed by #241
Open

Seed to randomize should not require an integer #49

eyelidlessness opened this issue Feb 28, 2024 · 0 comments · May be fixed by #241
Assignees
Labels
bug Something isn't working Error messaging Conveying error conditions to users @odk/xpath UI
Milestone

Comments

@eyelidlessness
Copy link
Member

Per spec, randomize accepts an optional seed. The current implementation currently checks that the seed is an integer, and throws (a string, a tangentially related my-bad) if it's not. This was derived from the implementation in OpenRosa XPath Evaluator, so I'd expect this bug affects Enketo as well. Which is somewhat surprising, because I discovered the bug by using XLSForms' prominent example for stable-randomization.

Steps to reproduce

  1. Use the aforementioned XLSForms example in a form

Expected behavior

  1. A form using a decimal/float seed to randomize will stably randomize options, without error
  2. Even if there is an error due to an actually invalid seed value, it will be surfaced to the user in some meaningful way
  3. Possibly some sort of recovery behavior for certain invalid seed values (like NaN or ""?), but this would potentially involve spec clarification

Observed behavior

(From memory, happy to repro again if needed) Form load fails without explanation.

@eyelidlessness eyelidlessness added bug Something isn't working @odk/xpath UI Error messaging Conveying error conditions to users labels Feb 28, 2024
brontolosone added a commit to brontolosone/web-forms that referenced this issue Oct 14, 2024
brontolosone added a commit to brontolosone/web-forms that referenced this issue Oct 14, 2024
brontolosone added a commit to brontolosone/web-forms that referenced this issue Oct 14, 2024
brontolosone added a commit to brontolosone/web-forms that referenced this issue Oct 15, 2024
brontolosone added a commit to brontolosone/web-forms that referenced this issue Oct 15, 2024
@lognaturel lognaturel added this to the Next milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Error messaging Conveying error conditions to users @odk/xpath UI
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants