We’re experiencing an issue where line item taxable properties are being reset to their original state after successfully updating them using bulkCartUpdate. The update appears to work initially but reverts after a few seconds.
Steps to Reproduce:
-
Add a line item to the cart using
addLineItem() -
Use
bulkCartUpdate()to settaxable: falseon all line items -
Observe that the update succeeds initially (confirmed via console logs)
-
After 2-3 seconds, the line items revert to
taxable: true
Code Implementation:
// Cart API setup
const { bulkCartUpdate, bulkAddLineItemProperties } = cart as CartApiContent;
// Update function
const bulkUpdateLineItemProperties = useCallback(async (lineItemUuid: string) => {
const updatedLineItems = cartSubscription.lineItems.map((item: any) => ({
...item,
taxable: false,
}));
// Update taxable property using bulkCartUpdate
const response = await bulkCartUpdate({
lineItems: updatedLineItems,
cartDiscounts: cartSubscription.cartDiscounts || [],
properties: cartSubscription.properties || {}
});
Expected Behavior:
- Line items should maintain
taxable: falseafter the update - The
bulkCartUpdateresponse should be persistent
Actual Behavior:
-
Line items temporarily show
taxable: false -
After 2-3 seconds, they revert to
taxable: true -
This happens even with loop prevention and proper state management
Debugging Information:
We’ve confirmed:
-
Cart Transform functions are disabled
-
No infinite loops in
useEffect -
bulkCartUpdatereturns success response -
bulkAddLineItemPropertiesexecutes without errors -
No other cart operations are interfering
Any advice or suggestions would be very much appreciated ![]()