fix(core-flows): Remove concurrent steps that rely on the same data update (#9438)
**What** The `updateTaxLinesWorkflow` rely on the cart shipping method meaning that concurrent refresh of shipping method can impact tax lines therefore leading to wrong tax lines
This commit is contained in:
committed by
GitHub
parent
c536f7caf5
commit
193f93464f
@@ -3,11 +3,11 @@ import {
|
||||
CreateLineItemForCartDTO,
|
||||
} from "@medusajs/framework/types"
|
||||
import {
|
||||
WorkflowData,
|
||||
WorkflowResponse,
|
||||
createWorkflow,
|
||||
parallelize,
|
||||
transform,
|
||||
WorkflowData,
|
||||
WorkflowResponse,
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import {
|
||||
@@ -120,15 +120,14 @@ export const addToCartWorkflow = createWorkflow(
|
||||
list: false,
|
||||
}).config({ name: "refetch–cart" })
|
||||
|
||||
parallelize(
|
||||
refreshCartShippingMethodsStep({ cart }),
|
||||
updateTaxLinesWorkflow.runAsStep({
|
||||
input: {
|
||||
cart_id: input.cart.id,
|
||||
items,
|
||||
},
|
||||
})
|
||||
)
|
||||
refreshCartShippingMethodsStep({ cart })
|
||||
|
||||
updateTaxLinesWorkflow.runAsStep({
|
||||
input: {
|
||||
cart_id: input.cart.id,
|
||||
items,
|
||||
},
|
||||
})
|
||||
|
||||
updateCartPromotionsWorkflow.runAsStep({
|
||||
input: {
|
||||
|
||||
Reference in New Issue
Block a user