fix(workflow-engine-*): Prevent passing shared context reference (#11873)
* fix(workflow-engine-*): Prevent passing shared context reference * fix(workflow-engine-*): Prevent passing shared context reference * prevent tests from hanging * fix event handling * add integration tests * use interval for scheduled in tests * skip tests for now * Create silent-glasses-enjoy.md * fix cancel * changeset * push multiple aliases * test multiple field alias * increase wait time to index on test --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2a18a75353
commit
13e159d8ad
@@ -84,7 +84,17 @@ export class WorkflowsModuleService<
|
||||
@MedusaContext() context: Context = {}
|
||||
) {
|
||||
options ??= {}
|
||||
options.context ??= context
|
||||
const {
|
||||
manager,
|
||||
transactionManager,
|
||||
preventReleaseEvents,
|
||||
...restContext
|
||||
} = context
|
||||
|
||||
options.context ??= restContext
|
||||
options.context.preventReleaseEvents ??=
|
||||
!!options.context.parentStepIdempotencyKey
|
||||
delete options.context.parentStepIdempotencyKey
|
||||
|
||||
const ret = await this.workflowOrchestratorService_.run<
|
||||
TWorkflow extends ReturnWorkflow<any, any, any>
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
MedusaError,
|
||||
TransactionState,
|
||||
TransactionStepState,
|
||||
isDefined,
|
||||
isPresent,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { WorkflowOrchestratorService } from "@services"
|
||||
@@ -115,8 +116,8 @@ export class InMemoryDistributedTransactionStorage
|
||||
return data
|
||||
}
|
||||
|
||||
const { idempotent } = options ?? {}
|
||||
if (!idempotent) {
|
||||
const { idempotent, store, retentionTime } = options ?? {}
|
||||
if (!idempotent && !(store && isDefined(retentionTime))) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user