ODK Collect not evaluating constraints when quickly tap "Next" via HID interface (Android)

Hi everyone,

I'm encountering an issue with ODK Collect (version 2025.1.0 Beta 1) where constraints and "required" questions within a field-list group are not being evaluated when data is input using a HID QR scanner on Android.

I've designed a workflow where the scanner inputs data into text fields, and I'm using escape characters (tab and space) to navigate between questions and trigger the "Next" button. The problem is that when I use this HID input method, I can bypass constraints and required questions within the field-list group. If I fill out the same form manually, the constraints and required fields are correctly enforced.

I understand that using escape characters for navigation might not be the recommended approach, but I suspect a similar issue could occur if the "Next" button is tapped quickly enough. I've attached a trimmed
Forum.xlsx (31.5 KB)
sample XLSForm demonstrating the problem.
Here, When I fill dtVN via QR Scanner and send TAB TAB TAB Space Space (when sVN is read only), I can bypass all constraints and required questions in grpValidadion group and finalise the form

Has anyone else experienced similar behavior with HID input or rapid "Next" button presses? Is there a known workaround or a setting I might be missing? Any insights would be greatly appreciated.

Thanks in advance!

1 Like

Hi @upulpp ! :wave:

I attempted to reproduce the issue you described, and at first, I wasn’t able to bypass the required fields no matter what I tried. However, after further testing under very specific conditions, I was able to replicate the behavior you observed.

My Findings:

Through my testing, I discovered that this issue primarily occurs on lower-end or older Android devices, particularly those with limited processing power (1 - 2 CPU cores) and 1 - 2 GiB of RAM (much lesser than what ODK Collect's documentation suggests). It appears to be an input speed-related issue.

How did I reproduce the issue?

  1. Since the List_Vehicle.csv file wasn’t provided in the original post, I created a dummy version to allow the form to function properly.
  2. Manually reproducing the input (tab > tab > tab > space > space) at high speed was challenging, so I used AutoHotKey to automate input.
  3. Initially, I tested on a high-performance Android device with 12 GiB of RAM and an 8-core processor, but I was unable to bypass the required fields no matter what!
  4. When I switched to a much lower-end device with only 1 GiB of available memory and a single-core processor, I was able to bypass the required fields and constraints.
  5. However, even though the required fields and constraints were bypassed, I still wasn’t able to finalize the form on the end screen where it prompts to "Finalize" or "Save as draft".

How did I resolve it?

  1. Upgrade to a more capable Android device (although there are more cost-effective solutions!).
  2. Adjust the “Inter-Character-Delay” setting on your HID Scanner: there should be a way to configure an inter character delay in the scanner’s settings or manual. I recommend setting a delay of 100 - 200 milliseconds between each input character.
  3. Check Android’s accessibility settings: some versions of Android allow you to introduce input delays, which may help mitigate the issue.

Lastly, the core problem here is the speed at which input is provided - on lower-end devices, ODK Collect struggles to process constraints when inputs are received too quickly. Adding a 100 - 200 millisecond delay between inputs should help ensure that ODK Collect processes constraints correctly, even on older devices.

I hope this helps! It was something interesting to look into! :smiling_face:

1 Like

This is a good recommendation for now.

That said, it should not ever be possible to bypass so we will look into addressing the underlying issue. Thanks for reporting, @upulpp, and for the great exploration, @MinimalPotato

2 Likes

Hi @MinimalPotato ,
Thank you for taking the time to look into this issue and for putting in the effort to reproduce it.

I’m currently using a Redmi 14 C, which is a relatively new model (2024). My budget QR scanner doesn’t provide a direct option to adjust the “Inter-Character Delay.” However, there is a character speed setting, which I’ve set to “ultra low.” Despite this, I still encounter the issue intermittently.

That said, this isn’t a major problem for my workflow. I just wanted to bring the issue to the attention. Thanks to everyone for the incredible work you’re doing!

2 Likes

Unsure if this is related but it feels like a speed issue also, so putting it here for info.

I had a form with two groups, and the last question in the first group was a trigger for an earlier question in the group to modify the field content. When I use the quick appearance on the last question, to try to jump directly to the next group, the trigger doesn't fire.

Going back to that group and deselecting the entry (which won't cause the quick jump) is treated as a change to the field and the trigger does work as expected.

Removing the quick appearance also causes the trigger to work as expected.

Enketo is not affected in this manner.

1 Like

Hi,
I think it's related to this.
I also observed similar occasions during testing.