@aikirun/workflow 0.22.0 → 0.23.1

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -581,12 +581,13 @@ var WorkflowRunHandleImpl = class {
581
581
  const delayMs = options?.interval ? toMilliseconds(options.interval) : 1e3;
582
582
  const maxAttempts = options?.timeout ? Math.ceil(toMilliseconds(options.timeout) / delayMs) : Number.POSITIVE_INFINITY;
583
583
  const retryStrategy = { type: "fixed", maxAttempts, delayMs };
584
- const afterStateTransitionId = this._run.stateTransitionId;
584
+ let afterStateTransitionId = this._run.stateTransitionId;
585
585
  const hasTerminated = async () => {
586
- const { terminated } = await this.api.workflowRun.hasTerminatedV1({
586
+ const { terminated, latestStateTransitionId } = await this.api.workflowRun.hasTerminatedV1({
587
587
  id: this._run.id,
588
588
  afterStateTransitionId
589
589
  });
590
+ afterStateTransitionId = latestStateTransitionId;
590
591
  return terminated;
591
592
  };
592
593
  const shouldRetryOnResult = async (terminated) => !terminated;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikirun/workflow",
3
- "version": "0.22.0",
3
+ "version": "0.23.1",
4
4
  "description": "Workflow SDK for Aiki - define durable workflows with tasks, sleeps, waits, and event handling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "build": "tsup"
19
19
  },
20
20
  "dependencies": {
21
- "@aikirun/types": "0.22.0",
21
+ "@aikirun/types": "0.23.1",
22
22
  "@standard-schema/spec": "^1.1.0"
23
23
  },
24
24
  "publishConfig": {