We have a Commerce system with heavy load.
As far as I know LineItemIds in a cart supposed to be unique for the cart - I also got this confirmed from a Commerce trainer. Our system depends on this.
Extremely rarely occurs a situation in production, when a cart contains LineItems where two of the LineItems have the same LineItemId.
In one example which we have there are 11 LineItems, where except two LineItems all others have unique LineItemId.
We have no overrides in functions which is used by cart.CreateLineItem(), including IOrderGroupFactory. The corrupted cart is persisted in SerializableCart, so the problem should happen before creating an order.
But exact reproduction steps are unknown for this.
Using Commerce version 11.2.3.
Is there any possible explanation for this or is it a known bug?
Thank you in advance!
Could you let me know the detailed code that you wrote for creating line item like how to set line item's property and when did you save the cart?
One more thing, did you set up load balancing in your production?
There's a bug for this, resolved in Commerce 11.2.5
Please check the release note here .
The bug is https://world.episerver.com/documentation/Release-Notes/ReleaseNote/?releaseNoteId=COM-5121, as always we recommend to upgrade to latest version available - in this case 12.14. If you can't afford to upgrade to a breaking change release then at least 11.8.5