fix(workflows-sdk):transaction id inheritence (#9507)

This commit is contained in:
Adrien de Peretti
2024-10-10 17:08:42 +02:00
committed by GitHub
parent 0058338d40
commit 7c5415ba3a
3 changed files with 4 additions and 8 deletions
@@ -269,9 +269,7 @@ describe("Workflow composer", () => {
expect(result).toEqual({ result: "hi from outside" })
expect(parentContext.transactionId).toEqual(expect.any(String))
expect(parentContext.transactionId).not.toEqual(
childContext.transactionId
)
expect(parentContext.transactionId).toEqual(childContext.transactionId)
expect(parentContext.eventGroupId).toEqual("eventGroupId")
expect(parentContext.eventGroupId).toEqual(childContext.eventGroupId)
@@ -317,9 +315,7 @@ describe("Workflow composer", () => {
expect(result).toEqual({ result: "hi from outside" })
expect(parentContext.transactionId).toBeTruthy()
expect(parentContext.transactionId).not.toEqual(
childContext.transactionId
)
expect(parentContext.transactionId).toEqual(childContext.transactionId)
expect(parentContext.eventGroupId).toBeTruthy()
expect(parentContext.eventGroupId).toEqual(childContext.eventGroupId)
@@ -199,9 +199,9 @@ export function createWorkflow<TData, TResult, THooks extends any[]>(
input: stepInput as any,
container,
context: {
transactionId: ulid(),
...sharedContext,
parentStepIdempotencyKey: stepContext.idempotencyKey,
transactionId: ulid(),
},
})