Data Element of Type "file" in Capture app always opens the most recently uploaded file for that data element across all events, instead of the file attached to the specific event being viewed in version 2.42

Steps to Reproduce

  1. In Capture, create/open Event A for Org Unit A.
  2. Upload File A into the File-type data element.
  3. Save the event.
  4. Create/open Event B for Org Unit B (same program/stage and same file-type data element).
  5. Upload File B into the same data element.
  6. Save the event.
  7. Go back and open Event A (Org Unit A).
  8. Click/open the file shown in the file-type data element.

Actual Result

  • Event A opens File B (the most recently uploaded file for that data element), not File A.
  • It behaves as if the file reference is not stored/loaded per event, but instead resolves to the latest uploaded file across events.

Expected Result

Event A should open/display File A (the file uploaded for Event A).

Impact

This is a data integrity / patient-record correctness risk:

  • Users cannot reliably view the correct attachment per event.
  • Historical event attachments appear to “change” after new uploads in other events/org units.

Frequency

  • Always
  • Reproducible consistently in 2.42 and on Play.

Hi @paleu256 :detective:

Thank you for reporting this issue. I can reproduce the issue. It appears that I don’t need to upload a new file for it to appear and all it takes is to go to another event click on the file link and view it then return and it will “replace” the previous file. It’s really strange, the links are all the same ids but will have different file:

I’m triaging this to the @dhis2-tracker team. Thank you!

1 Like