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:
Adrien de Peretti
2024-10-03 11:00:32 +02:00
committed by GitHub
parent c536f7caf5
commit 193f93464f

View File

@@ -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: "refetchcart" })
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: {