Anthony-Nolan / Atlas

A free & open-source Donor Search Algorithm Service
GNU General Public License v3.0
9 stars 5 forks source link

Set PublishedDateTime to UTC now on replayed donor update messages #1112

Closed zabeen closed 10 months ago

zabeen commented 11 months ago

Set PubishedDateTime here

Please also add unit test to cover this fix

zabeen commented 11 months ago

Test Notes

1) re-do test explained here: https://github.com/Anthony-Nolan/Atlas/issues/1053#issuecomment-1768760765 2) Check contents of the replayed update message and ensure the published datetime is correct

DmitriyShcherbina commented 10 months ago

@zabeen Me and Daria tried to reproduce steps described here but we only saw that message appeared in matching-transient-a and matching-transient-b with old "PublishedDateTime" (we re-sent old message from yesterday in audit subscription) and we didn't see how it was moved there and any logs related to this process.

Image

Maybe breaking SQL connection isn't enough to reproduce the situation when this algorithm could be tested?

zabeen commented 10 months ago

Thanks @DmitriyShcherbina, I will investigate further.

zabeen commented 10 months ago

Testing [2]

Method

  1. "Break" db connection strings SqlA and SqlB on DEV-ATLAS-MATCHING-DONOR-MANAGEMENT-FUNCTION by modifying username in the conn string. Save changes,
  2. Disable both DLQ listener functions on the same functions app so that any dead-lettered messages will remain on the DLQ.
  3. Upload a donor import file with a single new donor. The update message should appear on all subs of updated-searchable-donors topic, but will soon disappear from whichever sub represents the "dormant" db. It should remain on the "active db" sub until it dead-letters; this will take about 10-15 mins.
  4. After the message dead-letters, make note of the PublishedDateTime value in the message contents.
  5. Re-enable the two DLQ listener functions from step 2 and note the time. The dead-lettered message should disappear and be republished to the topic after a minute.
  6. Check the contents of the new message, it should have a datetime value similar to the time the DLQ functions were re-enabled.

Cleanup:

Results

Conclusion

Test passed