OpenClinica/enketo-express-oc

Infinite Alert Dialog loop if relevant error on group is present when Close is clicked

Closed this issue · 6 comments

Scenario A
Steps:

  1. Edit a new form (or existing form that is not yet completed) that has relevant logic applied to a group
  2. Enter data such that the group is relevant
  3. Enter data for items within the group
  4. Change data such that the group is no longer relevant
  5. Observe that the group shows a relevant error as expected
  6. Click the Close button
  7. Observe that a popup prompts the user about adding autoqueries as expected
  8. Click Proceed

Expected:
Autoqueries are added for the items within the group that have values and the form should close.

Actual:
Autoqueries are submitted (calls visible in the network tab), but the form simply remains open.

Screenshot 2023-02-17 001501

Scenario B

move to #649

scenario A

http://localhost:8005/single/fs/i/YYp2?ecid=1

However I see a successful redirect after successful submission of the autoquery.

  • figure out if autoquery fieldsubmission is generated - YES
  • look into whether proper message is send to parentWindow (so OC knows to redirect) - YES

@pbowen-oc are you using a /single/fs/i/ form view for scenario A?
Do you see any error message in the console for scenario A?

Will split off scenario B into a separate issue I think. I don't see how both scenarios could be related. => #649

I am able to reproduce the issue with a different form: http://localhost:8005/single/fs/i/pMWLRJo1?ecid=a

** The confirmation dialog shown in the screenshot remains open **

If I understand correctly an autoquery fixes any constraint and required violations (in the logic with comment-status()) but for relevant errors it does not. So autoqueries for relevantErrors are quite different.

Autoqueries for relevant errors and strict constraint/strict required errors are different in that they are only flagging the data as non-conforming but not also curing the error condition. For non-strict constraint and non-strict required errors, a query is flagging the data and also overriding the data issue to make the current state valid.

Looks good in testing