@rivetkit/workflow-engine 2.3.0-rc.8 → 2.3.0
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/tsup/{chunk-EAAPMGGE.js → chunk-DFNXCZ47.js} +8 -6
- package/dist/tsup/chunk-DFNXCZ47.js.map +1 -0
- package/dist/tsup/{chunk-A33YVYOF.cjs → chunk-U2W3KHJC.cjs} +8 -6
- package/dist/tsup/chunk-U2W3KHJC.cjs.map +1 -0
- package/dist/tsup/index.cjs +2 -2
- package/dist/tsup/index.d.cts +11 -7
- package/dist/tsup/index.d.ts +11 -7
- package/dist/tsup/index.js +1 -1
- package/dist/tsup/testing.cjs +23 -23
- package/dist/tsup/testing.js +1 -1
- package/package.json +1 -1
- package/schemas/serde.ts +1 -3
- package/src/context.ts +15 -11
- package/src/index.ts +8 -8
- package/src/location.ts +1 -1
- package/src/types.ts +3 -1
- package/dist/tsup/chunk-A33YVYOF.cjs.map +0 -1
- package/dist/tsup/chunk-EAAPMGGE.js.map +0 -1
|
@@ -1963,7 +1963,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
1963
1963
|
* Throws HistoryDivergedError if duplicate detected.
|
|
1964
1964
|
*/
|
|
1965
1965
|
checkDuplicateName(name) {
|
|
1966
|
-
const fullKey = locationToKey(this.storage, this.currentLocation)
|
|
1966
|
+
const fullKey = `${locationToKey(this.storage, this.currentLocation)}/${name}`;
|
|
1967
1967
|
if (this.usedNamesInExecution.has(fullKey)) {
|
|
1968
1968
|
throw new HistoryDivergedError(
|
|
1969
1969
|
`Duplicate entry name "${name}" at location "${locationToKey(this.storage, this.currentLocation)}". Each step/loop/sleep/queue.next/join/race must have a unique name within its scope.`
|
|
@@ -2017,7 +2017,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2017
2017
|
validateComplete() {
|
|
2018
2018
|
const prefix = locationToKey(this.storage, this.currentLocation);
|
|
2019
2019
|
for (const key of this.storage.history.entries.keys()) {
|
|
2020
|
-
const isUnderPrefix = prefix === "" ? true : key.startsWith(prefix
|
|
2020
|
+
const isUnderPrefix = prefix === "" ? true : key.startsWith(`${prefix}/`) || key === prefix;
|
|
2021
2021
|
if (isUnderPrefix) {
|
|
2022
2022
|
if (!this.visitedKeys.has(key)) {
|
|
2023
2023
|
throw new HistoryDivergedError(
|
|
@@ -2294,7 +2294,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2294
2294
|
entry.kind.data.error = String(error);
|
|
2295
2295
|
}
|
|
2296
2296
|
entry.dirty = true;
|
|
2297
|
-
if (error instanceof StepTimeoutError) {
|
|
2297
|
+
if (error instanceof StepTimeoutError && !config2.retryOnTimeout) {
|
|
2298
2298
|
metadata.status = "exhausted";
|
|
2299
2299
|
metadata.error = String(error);
|
|
2300
2300
|
await this.notifyStepError(config2, metadata.attempts, error, {
|
|
@@ -2350,7 +2350,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2350
2350
|
attachTryStepFailure(
|
|
2351
2351
|
new StepExhaustedError(config2.name, String(error)),
|
|
2352
2352
|
{
|
|
2353
|
-
kind: "exhausted",
|
|
2353
|
+
kind: error instanceof StepTimeoutError ? "timeout" : "exhausted",
|
|
2354
2354
|
stepName: config2.name,
|
|
2355
2355
|
attempts: metadata.attempts,
|
|
2356
2356
|
error: extractErrorInfo(error)
|
|
@@ -2368,7 +2368,9 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
|
|
|
2368
2368
|
*
|
|
2369
2369
|
* Note: This does NOT cancel the underlying operation. JavaScript Promises
|
|
2370
2370
|
* cannot be cancelled once started. When a timeout occurs:
|
|
2371
|
-
* - The step is
|
|
2371
|
+
* - The step is rejected with StepTimeoutError. By default this is treated
|
|
2372
|
+
* as a critical failure with no retry. Set retryOnTimeout: true on the
|
|
2373
|
+
* step config to retry timeouts like any other error.
|
|
2372
2374
|
* - The underlying async operation continues running in the background
|
|
2373
2375
|
* - Any side effects from the operation may still occur
|
|
2374
2376
|
*
|
|
@@ -4199,4 +4201,4 @@ export {
|
|
|
4199
4201
|
runWorkflow,
|
|
4200
4202
|
replayWorkflowFromStep
|
|
4201
4203
|
};
|
|
4202
|
-
//# sourceMappingURL=chunk-
|
|
4204
|
+
//# sourceMappingURL=chunk-DFNXCZ47.js.map
|