Skip to content

Commit a247a39

Browse files
committed
fix: clean up childWorkflowComplete entry on start failure
1 parent 6065780 commit a247a39

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/workflow/src/internals.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ export class Activator implements ActivationHandler {
628628
public resolveChildWorkflowExecutionStart(
629629
activation: coresdk.workflow_activation.IResolveChildWorkflowExecutionStart
630630
): void {
631-
const { resolve, reject } = this.consumeCompletion('childWorkflowStart', getSeq(activation));
631+
const seq = getSeq(activation);
632+
const { resolve, reject } = this.consumeCompletion('childWorkflowStart', seq);
632633
if (activation.succeeded) {
633634
if (!activation.succeeded.runId) {
634635
throw new TypeError('Got ResolveChildWorkflowExecutionStart with no runId');
@@ -648,11 +649,13 @@ export class Activator implements ActivationHandler {
648649
activation.failed.workflowType
649650
)
650651
);
652+
this.completions.childWorkflowComplete.delete(seq);
651653
} else if (activation.cancelled) {
652654
if (!activation.cancelled.failure) {
653655
throw new TypeError('Got no failure in cancelled variant');
654656
}
655657
reject(this.failureToError(activation.cancelled.failure));
658+
this.completions.childWorkflowComplete.delete(seq);
656659
} else {
657660
throw new TypeError('Got ResolveChildWorkflowExecutionStart with no status');
658661
}

0 commit comments

Comments
 (0)