Skip to content

Error for dequeuing samples not present at step - #1215

Merged
nafiz1001 merged 4 commits into
masterfrom
dequeueing-error
Oct 14, 2026
Merged

nafiz1001 merged 4 commits into
masterfrom
dequeueing-error

Conversation

@nafiz1001

Copy link
Copy Markdown
Collaborator

No description provided.

@nafiz1001
nafiz1001 requested a review from UlysseFG October 5, 2026 19:11
@nafiz1001 nafiz1001 changed the title error for dequeuing samples not present at step Error for dequeuing samples not present at step Oct 5, 2026
values_list = list(values_list)

if not values_list:
study = Study.objects.get(pk=study)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All get DB calls should be covered by the a try catch. The IDs might not exist.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

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,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE?

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}.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

…estroy_list

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nafiz1001
nafiz1001 requested a review from UlysseFG October 13, 2026 12:55
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}."`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use words like "... out of ..." instead of a weird fraction.

@nafiz1001
nafiz1001 merged commit 5b0607a into master Oct 14, 2026
5 checks passed
@nafiz1001
nafiz1001 deleted the dequeueing-error branch October 14, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants