getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
712 stars 1.37k forks source link

Missing events in audit log after validating answers in a field-list group when finalized #5550

Open dbemke opened 1 year ago

dbemke commented 1 year ago

ODK Collect version

2022.4.4, the store version 2023.1.2 ,the master version 1f9155c7f1f6c1d91532993fd45cc9b68270124a

Android version

10, 13

Device used

Redmi 9T, Pixel 6A

Problem description

When a user violates constraints in a field-list group with defer validation until finalized setting, the added/changed answers (from a field-list) are not present in audit csv file. In the Audit log there is an event of going to group (gr1) but events of questions (q1, q2) in a field-list are missing.

Steps to reproduce the problem

Scenario with constraints:

  1. In Settings→ Form management→ Constraint processing set "Defer validation until finalized”.
  2. Go to Audit field-list constraint track changes form. Audit field-list constraint track changes.xlsx.txt
  3. In Q1 enter A, Q2 enter B.
  4. Tap next.
  5. In Outside group enter C.
  6. Tap next and finalize and save the form.
  7. When validation constraint error appears in Q1 add aa, Q2 bb.
  8. Go to the hierarchy view, tap "go to end” and try to finalize the form again.
  9. When validation constraint error appears in Q3 add cc.
  10. Go to audit csv file and check if there are events for q1 and q2 after constraint error event. auditconstraintfieldlist

Scenario with required questions:

  1. In Settings→ Form management→ Constraint processing set "Defer validation until finalized”.
  2. Go to Audit field-list track changes required form. Audit field-list track changes required.xlsx.txt
  3. Don’t enter anything, go to the hierarchy view.
  4. Tap „Go to end”.
  5. Try to finalize and save the form.
  6. When moved to Q1 and Q2 fill the answers.
  7. Go to the hierarchy view and tap "go to end” and try to finalize the form again.
  8. When moved to outside group question, fill the answers.
  9. Tap „next” and finalize the form.
  10. Go to audit csv file and check if there are events for q1 and q2 after constraint error event. auditrequiredfieldlist

Expected behavior

After violating constraints and entering new values in a field-list events should be logged in audit csv.

seadowg commented 1 year ago

@dbemke I'm guessing the question events do get logged if constraint processing is set to "Validation upon forward swipe"?

dbemke commented 1 year ago

With validation upon forward swipe events are logged but there are 2 differences: no jumping to a question/ going the the hierachy view and there is no "constraint error" event.

Steps tried with "Validation upon forward swipe"":

  1. In Settings→ Form management→ Constraint processing set "Validation upon forward swipe".
  2. Go to Audit field-list constraint track changes form.
  3. In Q1 enter A, Q2 enter B.
  4. Tap next.
  5. When validation constraint error appears in Q1 add aa, Q2 bb.
  6. Tap next.
  7. In Outside group enter C.
  8. When validation constraint error appears in Q3 add cc.
  9. Tap next and save/send the form.

5550

seadowg commented 1 year ago

So "constraint error" events are missing when "Validation upon forward swipe" is set as well?

dbemke commented 1 year ago

When there is "Defer validation until finalized” the "constraint error" event appears in audit logs. When there is "Validation upon forward swipe" the "constraint error" event doesn't appear in the audit logs. As far as I remember with the new option "check for errors" the "constraint error" event doesn't appear in the audit logs. But what is the expected- I don't know.