Repository navigation
Error for dequeuing samples not present at step - #1215
Conversation
| values_list = list(values_list) | ||
|
|
||
| if not values_list: | ||
| study = Study.objects.get(pk=study) |
There was a problem hiding this comment.
All get DB calls should be covered by the a try catch. The IDs might not exist.
| title: "Error dequeuing samples from workflow", | ||
| description: `Failed to dequeue samples from study ${selectedStudy.letter} (workflow "${workflow.name}") at step "${step.step_name}" for project "${selectedProject.name}".`, | ||
| title: `Error dequeing samples at step ${step.step_name} of study ${selectedStudy.letter} (${workflow.name}).`, | ||
| description: e.data, |
There was a problem hiding this comment.
This may be overly technical for the user. The previous message was not as precise as possible but the new version might use language not intended for end user.
| if not values_list: | ||
| study = Study.objects.get(pk=study) | ||
| step_order = StepOrder.objects.get(order=stepOrder, workflow__studies=study) | ||
| return HttpResponseBadRequest(f"Could not find any samples selected for step '{step_order.step.name}' in study {study.letter}.") |
There was a problem hiding this comment.
Covers the case where there is no selected sample queued on the study step. If only part of the listed samples are not queued to the study step, it would not trigger this error and dequeueing a not queued sample does not raise an error. This may be correct for the backend, but maybe you could catch on the frontend side when the removed count does not match the requested id count. In this case, a warning notification might be a better response than a success notification.
…estroy_list Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
51a933f to
f3db7a3
Compare
| notifyWarning({ | ||
| id: NOTIFICATION_KEY, | ||
| title: "Some samples dequeued from workflow", | ||
| description: `Only dequeued ${samplesRemovedCount}/${sampleCount} samples from study ${selectedStudy.letter} (workflow "${workflow.name}") at step "${step.step_name}" for project "${selectedProject.name}."`, |
There was a problem hiding this comment.
you can use words like "... out of ..." instead of a weird fraction.
No description provided.