Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a task doesn't clean up references to the deleted task key #7011

Open
eatyourgreens opened this issue Jan 3, 2024 · 2 comments · May be fixed by #7099
Open

Deleting a task doesn't clean up references to the deleted task key #7011

eatyourgreens opened this issue Jan 3, 2024 · 2 comments · May be fixed by #7099

Comments

@eatyourgreens
Copy link
Contributor

Expected behavior

Deleting a task should delete all references to its task key, within that workflow.

Current behavior

task.next isn't cleaned up after deleting a task, leading to workflow tasks where task.next points to a deleted task key.

Steps to replicate

  1. Create a workflow such that T1 -> T2 -> Submit classification.
  2. Delete task T2.
  3. Examine task T1 to see that T1.next is still set to 'T2'.

Additional information

@eatyourgreens
Copy link
Contributor Author

Branching single answer questions that link to the deleted task are not cleaned up either.

@goplayoutside3
Copy link
Contributor

Linking the culprit function too:

handleTaskDelete(taskKey, e) {
const shortcut = this.props.workflow.tasks[taskKey].unlinkedTask;
if (e.shiftKey || confirm('Really delete this task?')) {
if (this.canUseTask(this.props.project, "transcription-task")) {
this.deleteStepAndTask(taskKey);
} else {
const changes = {};
if (shortcut) {
changes[`tasks.${shortcut}`] = undefined;
}
changes[`tasks.${taskKey}`] = undefined;
this.props.workflow.update(changes);
}
return this.updateFirstTask();
}
}
}

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 a pull request may close this issue.

2 participants