fix: persist and retry run alerts and honor notification modes
This commit is contained in:
@@ -172,6 +172,7 @@ function sameResourceWait(a, b) {
|
||||
/** The run-state fields a frame advances, shared by the summary row and the detail. */
|
||||
function runStateFields(current) {
|
||||
return {
|
||||
notify_mode: current.notify_mode ?? "auto",
|
||||
resource_wait: current.resource_wait ?? null,
|
||||
status: current.status ?? "",
|
||||
outcome: current.outcome ?? "",
|
||||
@@ -196,6 +197,7 @@ function applyRunStateFields(current, frame) {
|
||||
? "queued"
|
||||
: advanceRunStatus(before.status, frame.status);
|
||||
const merged = {
|
||||
notify_mode: blank(frame.notify_mode) ? before.notify_mode : frame.notify_mode,
|
||||
resource_wait: isTerminalRunStatus(status)
|
||||
? null
|
||||
: frame.resource_wait_set === true
|
||||
@@ -210,6 +212,7 @@ function applyRunStateFields(current, frame) {
|
||||
executing: executingFor(status, before.executing),
|
||||
};
|
||||
const changed =
|
||||
merged.notify_mode !== before.notify_mode ||
|
||||
!sameResourceWait(merged.resource_wait, before.resource_wait) ||
|
||||
merged.status !== before.status ||
|
||||
merged.outcome !== before.outcome ||
|
||||
@@ -236,6 +239,7 @@ export function newRunSummaryFromFrame(frame) {
|
||||
id: Number(frame.run_id),
|
||||
pipeline_id: pipelineId,
|
||||
name,
|
||||
notify_mode: frame.notify_mode ?? "auto",
|
||||
title: blank(frame.title) ? null : frame.title,
|
||||
version: Number(frame.version) || 0,
|
||||
status: frame.status ?? "",
|
||||
|
||||
Reference in New Issue
Block a user