fix: keep cancellation pending until execution cleanup is confirmed
This commit is contained in:
+11
-1
@@ -181,6 +181,8 @@ function runStateFields(current) {
|
||||
created_at: current.created_at ?? "",
|
||||
finished_at: current.finished_at ?? "",
|
||||
executing: Boolean(current.executing),
|
||||
cancel_requested: Boolean(current.cancel_requested),
|
||||
cleanup_unconfirmed: Boolean(current.cleanup_unconfirmed),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -210,6 +212,8 @@ function applyRunStateFields(current, frame) {
|
||||
created_at: blank(frame.created_at) ? before.created_at : frame.created_at,
|
||||
finished_at: blank(frame.finished_at) ? before.finished_at : frame.finished_at,
|
||||
executing: executingFor(status, before.executing),
|
||||
cancel_requested: before.cancel_requested || frame.cancel_requested === true,
|
||||
cleanup_unconfirmed: before.cleanup_unconfirmed || frame.cleanup_unconfirmed === true,
|
||||
};
|
||||
const changed =
|
||||
merged.notify_mode !== before.notify_mode ||
|
||||
@@ -220,7 +224,9 @@ function applyRunStateFields(current, frame) {
|
||||
merged.completed_steps !== before.completed_steps ||
|
||||
merged.created_at !== before.created_at ||
|
||||
merged.finished_at !== before.finished_at ||
|
||||
merged.executing !== before.executing;
|
||||
merged.executing !== before.executing ||
|
||||
merged.cancel_requested !== before.cancel_requested ||
|
||||
merged.cleanup_unconfirmed !== before.cleanup_unconfirmed;
|
||||
return changed ? { ...current, ...merged } : current;
|
||||
}
|
||||
|
||||
@@ -244,6 +250,8 @@ export function newRunSummaryFromFrame(frame) {
|
||||
version: Number(frame.version) || 0,
|
||||
status: frame.status ?? "",
|
||||
executing: executingFor(frame.status, true),
|
||||
cancel_requested: frame.cancel_requested === true,
|
||||
cleanup_unconfirmed: frame.cleanup_unconfirmed === true,
|
||||
outcome: frame.outcome ?? "",
|
||||
current_stage: frame.current_stage ?? "",
|
||||
created_at: frame.created_at ?? "",
|
||||
@@ -361,6 +369,8 @@ export function runDetailNeedsFullSync(frame) {
|
||||
return (
|
||||
stepSettled ||
|
||||
stepWaiting ||
|
||||
frame?.cancel_requested === true ||
|
||||
frame?.cleanup_unconfirmed === true ||
|
||||
isTerminalRunStatus(frame?.status) ||
|
||||
isWaitingRunStatus(frame?.status)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user