@workglow/task-graph 0.2.25 → 0.2.27

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.
package/dist/browser.js CHANGED
@@ -6820,15 +6820,16 @@ class IteratorTaskRunner extends GraphAsTaskRunner {
6820
6820
  this.aggregatingParentMapProgress = false;
6821
6821
  }
6822
6822
  }
6823
- emitMapParentProgressFromPartials(childMessage) {
6823
+ emitMapParentProgressFromPartials(childMessage, activeIterationIndex) {
6824
6824
  const n = this.mapPartialIterationCount;
6825
6825
  if (n <= 0)
6826
6826
  return;
6827
6827
  const sum = this.mapPartialProgress.reduce((a, b) => a + b, 0);
6828
6828
  const overall = Math.round(sum / n);
6829
6829
  const done = this.mapPartialProgress.filter((v) => v >= 100).length;
6830
- const base = `Map ${done}/${n}`;
6831
- const msg = childMessage ? `${base} — ${childMessage}` : `${base} iterations`;
6830
+ const displayIteration = activeIterationIndex === undefined ? done : Math.min(activeIterationIndex + 1, n);
6831
+ const base = `Map ${displayIteration}/${n}`;
6832
+ const msg = activeIterationIndex === undefined ? `${base} iterations` : childMessage ? `${base} — ${childMessage}` : base;
6832
6833
  this.handleProgress(overall, msg);
6833
6834
  }
6834
6835
  async executeReduceIterations(analysis) {
@@ -6901,7 +6902,7 @@ class IteratorTaskRunner extends GraphAsTaskRunner {
6901
6902
  this.task.emit("iteration_progress", index, iterationCount, p, message);
6902
6903
  if (p !== undefined && this.aggregatingParentMapProgress && this.mapPartialIterationCount > 0) {
6903
6904
  this.mapPartialProgress[index] = Math.max(this.mapPartialProgress[index] ?? 0, p);
6904
- this.emitMapParentProgressFromPartials(message);
6905
+ this.emitMapParentProgressFromPartials(message, index);
6905
6906
  }
6906
6907
  };
6907
6908
  const unsubscribeGraphProgress = graphClone.subscribe("graph_progress", onGraphProgress);
@@ -9520,4 +9521,4 @@ export {
9520
9521
  BROWSER_GRANTS
9521
9522
  };
9522
9523
 
9523
- //# debugId=ACC45209753EA44664756E2164756E21
9524
+ //# debugId=F6687CC0A5804F0964756E2164756E21