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

Harness@5 attempting to fill some invisible questions #271

Open
kennsippell opened this issue Nov 21, 2024 · 5 comments
Open

Harness@5 attempting to fill some invisible questions #271

kennsippell opened this issue Nov 21, 2024 · 5 comments
Assignees

Comments

@kennsippell
Copy link
Member

kennsippell commented Nov 21, 2024

Describe the bug

To Reproduce
moh-kenya/config-echis-2.0@12981-noverify-when-chp
TZ=Africa/Nairobi npx mocha --reporter spec --timeout 120000 --slow 5000 ./test/tasks/postnatal_care_service.spec.js

Scenario leads to:

questions have new classes like contains-ref-target pre-init and contains-ref-target which form-filler thinks are visible

console errors

no context element found /postnatal_care_service/newborn_details/child/data/_screening/_not_feeding 0
ERROR JSHandle@object

I'm working on a minimal repro

Environment:

  • Regression when upgrading from 3.x to 5.x
@jkuester
Copy link
Contributor

Just a quick follow up here to note that I am digging into the error message:

no context element found /postnatal_care_service/newborn_details/child/data/_screening/_not_feeding 0
ERROR JSHandle@object

I have successfully reproduced this running live on a CHT instance, so this is not endemic to cht-form or the test-harness. While the error does not seem to prevent the form from being submitted with the necessary data, I think it is noticeable to the user. I am pretty sure that it is causing read-only text boxes to apprear on the summary page:

Image

I am still running down the exact cause of the issue (will report back when I have more info), but it seems likely to me that it is an Enketo bug (enketo/enketo#99 resulted in a similar error in the logs).

@jkuester
Copy link
Contributor

jkuester commented Dec 2, 2024

Okay, I have been able to track this no context element found error back down to a problem with the base Enekto logic and I have logged: enketo/enketo#1377.

See that issue for more details, but TLDR is that there seems to be issues handling relevant expressions in a repeat with no entries when adding additional entries to a separate repeat group....

@mrjones-plip
Copy link

mrjones-plip commented Dec 3, 2024

Thanks for chasing down the issue @jkuester ! Is this an issue we can fix in CHT Core with a patch to our enketo then? Another way of asking this is: what workarounds, if any, are there? Is it just "avoid this combo in your form" kinda thing?

@jkuester
Copy link
Contributor

jkuester commented Dec 3, 2024

So, on the enketo ticket I noted a workaround that seemed viable for the basic repro case (just making the repeat group non-relevant when it is empty), but I was never able to get the to work with the postnatal_care_service form (perhaps because the relevant expression for the field in the empty repeat actually depends on the field that determines the repeat_count...).

If it turns out to be a simple fix in Enketo, we can definitely patch it in cht-core while we wait on a new version of Enekto. However, I have not determined how this can/should be fixed in enketo-core at this point. More investigation is needed. @kennsippell (et al) I have logged medic/cht-core#9684 to track this on the CHT side. It would be useful to have folks weigh in out on that issue regarding the priority/impact of this issue. Thanks!

@mrjones-plip
Copy link

Thanks a bunch @jkuester !

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

3 participants