@agimon-ai/doompi-workflow 0.0.1-alpha.100 → 0.0.1-alpha.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,6 +238,11 @@ function foldWorkflowProgress(events) {
238
238
  jobs.push(job);
239
239
  }
240
240
  if (event.type === "job") {
241
+ if (event.status === "running" && (event.index !== void 0 || job.status !== "running")) {
242
+ delete job.reason;
243
+ delete job.endedAt;
244
+ delete job.startedAt;
245
+ }
241
246
  job.status = event.status;
242
247
  if (event.reason !== void 0) job.reason = event.reason;
243
248
  if (event.index !== void 0) job.index = event.index;
@@ -254,7 +259,7 @@ function foldWorkflowProgress(events) {
254
259
  status: event.status
255
260
  };
256
261
  job.steps.push(step);
257
- } else if (event.status === "running" && step.status !== "running") {
262
+ } else if (event.status === "running" && (event.index !== void 0 || step.status !== "running")) {
258
263
  delete step.ref;
259
264
  delete step.reason;
260
265
  delete step.endedAt;
@@ -1059,7 +1064,7 @@ function stepRefsFrom(events) {
1059
1064
  const key = `${event.job}\u0000${event.step}`;
1060
1065
  const previous = steps.get(key);
1061
1066
  const running = event.status === "running";
1062
- const restarted = running && previous?.running !== true;
1067
+ const restarted = running && (event.index !== void 0 || previous?.running !== true);
1063
1068
  if (restarted) steps.delete(key);
1064
1069
  const ref = event.ref ?? (restarted ? void 0 : previous?.ref);
1065
1070
  steps.set(key, {