sequencescape
sequencescape copied to clipboard
Y24-236 - [BUG] Uploading the same manifest concurrently can cause duplicate samples/aliquots to be created.
Describe the bug When uploading the same manifest twice, and the second upload occurs before the first one has finished, duplicate records for samples and aliquots are created. A breakdown of this bug is in the additional context story linked below. Essentially it is a concurrency error caused by users being allowed to upload a manifest even if a version of that manifest is currently being processed.
RT Ticket Number If applicable
To Reproduce Steps to reproduce the behaviour:
- Create a sample manifest and fill it in.
- Upload the sample manifest and upload it again in quick succession. Note: The larger the manifest the longer it takes to upload, this means the uploads don't have to be in quick succession as processing takes a while, but the second one has to occur before the first one has finished.
Expected behaviour When users upload a manifest that is currently being processed, the upload is rejected and users are shown an appropriate error message.
A suggested implementation for this is to 'lock' a manifest. When uploading a manifest we could add a check to see if the manifest is currently being processed (this should be fairly trivial as manifests already use a state machine for state management). There should then be an appropriate error message for the user telling them to wait.
Other possible implementations can be seen in the attached document in the story in 'additional context'.
Additional context This is a follow on story from https://github.com/sanger/sequencescape/issues/4193