Skip to content

Commit b28cd84

Browse files
committed
fix: step.ts handling corrupted step invocation log
1 parent 54ba188 commit b28cd84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/step.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export function createUseStep(ctx: WorkflowOrchestratorContext) {
7474
// Step has started - so remove from the invocations queue (only on the first "step_started" event)
7575
if (!hasSeenStepStarted) {
7676
// O(1) lookup and delete using Map
77-
ctx.invocationsQueue.delete(correlationId);
77+
if (ctx.invocationsQueue.has(correlationId)) {
78+
ctx.invocationsQueue.delete(correlationId);
7879
} else {
7980
setTimeout(() => {
8081
reject(

0 commit comments

Comments
 (0)