Skip to content

Commit b334f64

Browse files
committed
🐛 Update task terminal state check to include "SucceededWithErrors"
Resolves: #2017 The check used to only allow starting an analysis if an application's analysis task is still running (i.e. not in a terminal state) needs to also consider the frontend synthetic state `SucceededWithErrors` as a non-running / terminal state. Signed-off-by: Scott J Dickerson <[email protected]>
1 parent 4182243 commit b334f64

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

client/src/app/pages/applications/applications-table/applications-table.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import {
7676
useFetchApplications,
7777
} from "@app/queries/applications";
7878
import {
79+
TaskStates,
7980
useCancelTaskMutation,
8081
useFetchTaskDashboard,
8182
} from "@app/queries/tasks";
@@ -609,12 +610,10 @@ export const ApplicationsTable: React.FC = () => {
609610
.flatMap((app) => app.tasks.currentAnalyzer)
610611
.filter(Boolean);
611612

612-
const terminalStates = ["Succeeded", "Failed", "Canceled", ""];
613-
614613
return (
615614
currentAnalyzerTasksForSelected.length === 0 ||
616615
currentAnalyzerTasksForSelected.every(({ state }) =>
617-
terminalStates.includes(state ?? "")
616+
TaskStates.Terminal.includes(state ?? "")
618617
)
619618
);
620619
};

client/src/app/queries/tasks.ts

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const TaskStates = {
2828
Running: ["Running"],
2929
Success: ["Succeeded", "SucceededWithErrors"],
3030
SuccessWithErrors: ["SucceededWithErrors"],
31+
Terminal: ["Succeeded", "SucceededWithErrors", "Failed", "Canceled"],
3132
};
3233

3334
export const TasksQueryKey = "tasks";

0 commit comments

Comments
 (0)