Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/workflow/src/internals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,8 @@ export class Activator implements ActivationHandler {
public resolveChildWorkflowExecutionStart(
activation: coresdk.workflow_activation.IResolveChildWorkflowExecutionStart
): void {
const { resolve, reject } = this.consumeCompletion('childWorkflowStart', getSeq(activation));
const seq = getSeq(activation);
const { resolve, reject } = this.consumeCompletion('childWorkflowStart', seq);
if (activation.succeeded) {
if (!activation.succeeded.runId) {
throw new TypeError('Got ResolveChildWorkflowExecutionStart with no runId');
Expand All @@ -648,11 +649,13 @@ export class Activator implements ActivationHandler {
activation.failed.workflowType
)
);
this.completions.childWorkflowComplete.delete(seq);
} else if (activation.cancelled) {
if (!activation.cancelled.failure) {
throw new TypeError('Got no failure in cancelled variant');
}
reject(this.failureToError(activation.cancelled.failure));
this.completions.childWorkflowComplete.delete(seq);
} else {
throw new TypeError('Got ResolveChildWorkflowExecutionStart with no status');
}
Expand Down