opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
85 stars 67 forks source link

Duplicate records (for both Birth and Death) Not Flagged when both records are created Offline #7215

Open tiri39 opened 3 months ago

tiri39 commented 3 months ago

Bug description: If two same records are created offline and sent or approval, and then switched to online mode, the record leaves outbox without the duplicate warning toast "(tracking id) is a potential duplicate. Record is ready for review".

Steps to reproduce:

  1. Login as RA.
  2. Create two same records in offline mode.
  3. Send the records for approval and observe them in outbox.
  4. Switch to online.
  5. Observe that the records leaves outbox without the toast - "(tracking id of the second) is a potential duplicate. Record is ready for review".
  6. Navigate to the Ready for Review workqueue and observe that the second record is not in this workqueue.
  7. Navigate to the Sent for Approval workqueue and observe that both the records are in this workqueue.

Actual result: Both the records are in the Sent for Approval workqueue.

Expected result: The second record should be in the Ready for Review workqueue and should have the duplicate icon.

Screenshot/Recording:

https://github.com/opencrvs/opencrvs-core/assets/113257751/ea1918b6-2162-496e-98ae-97433eb63120

Tested on: https://login.farajaland-qa.opencrvs.org/

Version: V1.5.0

eduffus commented 3 months ago

@SyedaAfrida assume this is nothing to do with being in a mobile so would happen on an offline desktop also. If so, I agree this is a Medium priority. Processing should be sequential so that 2nd record is flagged as a duplicate.

eduffus commented 3 months ago

Pushed to 1.7 as this is too difficult to fix in time for v1.5 and is just a corner case where deduplication logic is not applied, so processing can still continue.

tareq89 commented 2 months ago

We have a situation where two similar declarations are created offline. When the internet connection is restored, the web app tries to push all these offline-created declarations to the server simultaneously. The server receives all these requests at once and does not have enough time to determine which declarations are duplicates. As a result, it fails to detect simultaneously created duplicate documents.

Pushing offline declarations one by one is not a viable solution, as it would take too long to create the offline declarations. We need a technical design discussion to address and solve this bug.