Skip to content

Commit 8176d0f

Browse files
chore(core-flows): revert idempotent cart (#13336)
1 parent be9b293 commit 8176d0f

File tree

13 files changed

+18
-11
lines changed

13 files changed

+18
-11
lines changed

.changeset/big-coins-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@medusajs/core-flows": patch
3+
---
4+
5+
chore(core-flows): revert idempotent cart

integration-tests/http/__tests__/promotions/admin/promotions.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ medusaIntegrationTestRunner({
727727
storeHeaders
728728
)
729729
.catch(() => {}),
730+
/*
730731
api
731732
.post(
732733
`/store/carts/${cart.id}`,
@@ -736,6 +737,7 @@ medusaIntegrationTestRunner({
736737
storeHeaders
737738
)
738739
.catch(() => {}),
740+
*/
739741
])
740742

741743
const cartAfterPromotion = (

packages/core/core-flows/src/cart/workflows/add-to-cart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const addToCartWorkflowId = "add-to-cart"
116116
export const addToCartWorkflow = createWorkflow(
117117
{
118118
name: addToCartWorkflowId,
119-
idempotent: true,
119+
idempotent: false,
120120
},
121121
(input: WorkflowData<AddToCartWorkflowInputDTO & AdditionalData>) => {
122122
const cartQuery = useQueryGraphStep({

packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const createPaymentCollectionForCartWorkflowId =
8181
export const createPaymentCollectionForCartWorkflow = createWorkflow(
8282
{
8383
name: createPaymentCollectionForCartWorkflowId,
84-
idempotent: true,
84+
idempotent: false,
8585
},
8686
(
8787
input: WorkflowData<CreatePaymentCollectionForCartWorkflowInputDTO>

packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const refreshCartItemsWorkflowId = "refresh-cart-items"
130130
export const refreshCartItemsWorkflow = createWorkflow(
131131
{
132132
name: refreshCartItemsWorkflowId,
133-
idempotent: true,
133+
idempotent: false,
134134
},
135135
(input: WorkflowData<RefreshCartItemsWorkflowInput & AdditionalData>) => {
136136
const setPricingContext = createHook(

packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const refreshCartShippingMethodsWorkflowId =
5252
export const refreshCartShippingMethodsWorkflow = createWorkflow(
5353
{
5454
name: refreshCartShippingMethodsWorkflowId,
55-
idempotent: true,
55+
idempotent: false,
5656
},
5757
(input: WorkflowData<RefreshCartShippingMethodsWorkflowInput>) => {
5858
const fetchCart = when("fetch-cart", { input }, ({ input }) => {

packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const refreshPaymentCollectionForCartWorkflowId =
5656
export const refreshPaymentCollectionForCartWorkflow = createWorkflow(
5757
{
5858
name: refreshPaymentCollectionForCartWorkflowId,
59-
idempotent: true,
59+
idempotent: false,
6060
},
6161
(input: WorkflowData<RefreshPaymentCollectionForCartWorklowInput>) => {
6262
const fetchCart = when("should-fetch-cart", { input }, ({ input }) => {

packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const refundPaymentAndRecreatePaymentSessionWorkflowId =
6464
export const refundPaymentAndRecreatePaymentSessionWorkflow = createWorkflow(
6565
{
6666
name: refundPaymentAndRecreatePaymentSessionWorkflowId,
67-
idempotent: true,
67+
idempotent: false,
6868
},
6969
(
7070
input: WorkflowData<refundPaymentAndRecreatePaymentSessionWorkflowInput>

packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const transferCartCustomerWorkflowId = "transfer-cart-customer"
5151
export const transferCartCustomerWorkflow = createWorkflow(
5252
{
5353
name: transferCartCustomerWorkflowId,
54-
idempotent: true,
54+
idempotent: false,
5555
},
5656
(input: WorkflowData<TransferCartCustomerWorkflowInput>) => {
5757
const cartQuery = useQueryGraphStep({

packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const updateCartPromotionsWorkflowId = "update-cart-promotions"
7575
export const updateCartPromotionsWorkflow = createWorkflow(
7676
{
7777
name: updateCartPromotionsWorkflowId,
78-
idempotent: true,
78+
idempotent: false,
7979
},
8080
(input: WorkflowData<UpdateCartPromotionsWorkflowInput>) => {
8181
const fetchCart = when("should-fetch-cart", { input }, ({ input }) => {

0 commit comments

Comments
 (0)