Problem with Expressions after last Enketo Update - Preview Load Error

Description

Some expressions create Load Error in Enketo Preview on Toolbox. The form opens, but the expression is no more working. This seems very new, since last Update.
Some recent posts in the KoBo forum seem to indicate the same problem.

But in XLSForm Online (ODK) it works well and doesn’t show an error. Also in Toolbox the form can still be deployed without error.

Steps to Reproduce

BUG_Test01.xlsx (24.2 KB)

  1. Import XLS example

  2. Preview >> Error

  3. Test form behaviour >> Calculation not active

  4. Deploy >> Ok

  5. See XLS Remarks for more details (incl. syntax variants working

  6. Import XLS into https://getodk.org/xlsform/ >> Ok

  7. Preview Form there >> Works well.

Expected behavior

Expression evaluations work as expected and before.
Xmas Updates do not provide such essential side-effects (more robust testing before, please)…

Actual behavior

Some expressions are evaluated (parsed?) wrong. It happens with certain elements, like … != “” and … This BUG seems new after last release.
KoBoToolbox Preview


Works well in ODK XLSForm Online

Additional details

Current Enketo, Toolbox and ODK Online versions.

The BUG happens with some expression syntax in general: e.g. if (…) in calculation, expression in choice_filter and constraints .

In the example, we note which syntax creates the Error and which other syntax works well with KoBo Preview.

Two other examples, creating KoBo Preview (BUG) message
constraint:
count-selected(.) <= 2 and not(contains(${Nationality}, ‘-’)) and not( (selected(., ‘XXA’) or selected(., ‘908’)) and count-selected(.) != 1)
calculation;
if( (${FSLackFoodMonth} != “” or ${FSLackFood12MFreq} = 0) and ( count-selected(${ShockEvent}) > 0 or count-selected(${ShockCoping}) > 0 ), 1, 2 )
Feedback to the community seems urgent.

Beside Preview, It might also block viewing and editing of submitted data. Someone should test this soon, as this might even destroy collected data elements on edit on the server?
It’s urgent to know IF the Bug also touches view and EDIT of data!

Thank you for testing this and reporting it to the community @wroos! This should definitely be a bug. (that is related with the latest release of the Enketo).

Re-tested this with a slightly modified version of your xlsform:

BUG_Test01.xlsx (24.3 KB)

Could see a loading error issue with Enketo:

But did not see any issue while validating it with the online validator. Nor did it have any issue while loading it with Collect android app.

Yes, that’s it.
Now another character in Error “t” before “e”. The syntax/evaluation parser seems doing something crazy here.
It is also working in ODK XLSForm Previewer (see our screenshot).

In the Remarks column, we give different syntax examples, working and not working in Preview. You may try them. I think, they can be helpful hints for developers to locate the Bug. (So, please, forward our original example (incl. the comments.)

Can you say already (or even form general knowledge of the links between the Toolbox components,

  • Does this Bug also create a problem for viewing and edition of data?
  • And for collecting data online?
  • Or is this limited (100 %) to form Preview feature?

Your test seems to say YES for the first 2 points. So this Bug may really destroy data elements, no more apply existing Form constraints etc.

What is the way-forward now, please?

How is the KoBoToolbox Previewer relating to the ODK XLSForm Previewer? Which is the Master? Which a Fork?

Looking at the recent issues being lodged in the community i can guess that this issue can also be affecting editing and viewing while collecting data through Enketo.

YES. :scream: People should really take care at the moment. :bomb:

With your test, it seems clear, that this bug also effects editing/cleaning work for submitted Collect data.
Users can check their risk by Previewing the currently used form in KoBo. If they have such “Load Error” (but it’s fine in ODK check) they are definitely touched for edit or online data collection.

Is there any workaround to avoid data loss and wrong expression behaviour?

Data should not get loss. But would advise the community to temporarily halt the activity (until the issue is solved) if the users are using Enketo. Also please be informed that the issue has already been flagged with the developers.

3 questions, please:

  • Is it NOT also Enketo (as in Preview) when we edit submitted (e.g. Collect) data on the server?
  • Do you mean people should stop working with Enketo data collection temporarily? As several expressions may not work?
  • Estimation: How long?

Hi @wroos
This issue has been noted and we are currently running a temporary solution as indicated in the below

Stephane

2 Likes

Enketo is now at 2.7.3 and kobo is still at 2.3.3 Release Notes - Enketo - version 2.3.3

  1. Has enketo fixed the issue in the later releases?
  2. Is there a github issue for upgrading to the latest enketo in kobotoolbox?

I have been eagerly waiting for the enketo release in kobo to be updated since the 2.6 and later enketo releases has major performance improvements.

@manu_j, yes you got that correct! Enketo in KoBoToolbox is still behind. KoBoToolbox will make a release soon but at moment we don’t have any specific dates on when this is going to happen. However, will let you know when we have a specific date for the same.

Hi @wroos, I have tested this with the Enketo staging server running 2.7.3 and it seems to be working as expected. Can you please confirm that those other example cases are also working :pray:

1 Like