Short description of issue
parseFormData in shop_events_listener.js deduplicates items by variant ID, causing a mismatch when the same variant appears twice with different properties (e.g. BXGY deals). Results in “Payload body and response have different number of items” console error and dropped analytics events.
Reproduction steps
- Send a fetch /cart/add request with two items that share the same variant ID but have different properties values
- Observe console warning: [shop_events_listener] Error in handleFetchRequest: Payload body and response have different number of items
This happens because parseFormData merges items with the same id into one, so the payload item count (1) doesn’t match the cart API response item count (2). The cart API correctly keeps them separate because their properties differ.
Additional info
No customer-facing impact — the add-to-cart succeeds and the error is caught/swallowed. Only analytics tracking is silently dropped for the request.
Affects any app that sends two lines of the same variant with different properties (e.g. BXGY free item + paid item).
What type of topic is this
Bug report
