Cht-core: Medic ID never generated if a report is created before sentinel ID is generated

Created on 17 Jan 2020  路  5Comments  路  Source: medic/cht-core

Describe the bug
Medic ID never generated if a report is created before sentinel ID is generated

To Reproduce
Steps to reproduce the behavior:

  1. Go to '#/contacts/'
  2. Click on 'Add New Person'
  3. Quickly create a report for that person before the ID is generated
  4. Sync
  5. Notice the person's ID was not generated
  6. Notice errors in report with messages.generic.registration_not_found

Expected behavior
Ideally, the ID should still be generated and report associated to that contact with no errors

Screenshots
If applicable, add screenshots to help explain your problem.
image

image

Environment

  • Instance: alpha.dev.medicmobile.org
  • Browser: Firefox, Chrome
  • Client platform: MacOS
  • App: webapp
  • Version: 3.8.*
Bug

All 5 comments

What config is being used here? Based on the symptom, I would guess Standard, in which case this is expected and not a major concern. It is also not something new so shouldn't block the release.

This scenario will occur if the config relies on the medic ID instead of the UUID, as is the case when CHWs use SMS flows. In SMS flows the second report cannot happen before the registration is completed and the person's ID is sent to the CHW.

Can you check that the Medic ID is still eventually created? If it is, then we can move this to fixing the given config.

@ngaruko if you're creating contacts and submitting reports as an offline user, in order for the device to get the updated contact with the patient_id, you might need to sync twice, once to upload the contact document to the sever and the second time to download the updated contact, that includes the patient_id, after Sentinel has processed the doc.
To make sure you sync the 2nd time after Sentinel has added the patient_id, you can check the same contact as an admin user (who should get the updates in real time).

On the other hand, @ngaruko is probably right that we are adding messages.generic.registration_not_found when the report has a patient_uuid and no patient_id, so assigning myself to fix that.

Ready for AT on 6205-no-errors-for-patient-uuid - this branch should fix reports getting an incorrect registration_not_found error.

LTGM.

Was this page helpful?
0 / 5 - 0 ratings