fix(workflows): compensation handling (#5691)

This commit is contained in:
Adrien de Peretti
2023-11-23 10:11:03 +01:00
committed by GitHub
parent 6025c702f3
commit 010560fd2a
3 changed files with 44 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ type InvokeFn<TInput extends object, TOutput, TCompensateInput> = (
>>
type CompensateFn<T> = (
input: T,
input: T | undefined,
context: StepExecutionContext
) => unknown | Promise<unknown>
@@ -121,7 +121,7 @@ function applyStep<
context: transactionContext.context,
}
const stepOutput = transactionContext.invoke[stepName].output
const stepOutput = transactionContext.invoke[stepName]?.output
const invokeResult =
stepOutput?.__type === SymbolWorkflowStepResponse
? stepOutput.compensateInput &&