AntiPattern
Cart State Computation Errors
incorrect-cart-logic-identity-and-reduction
Cart logic fails because item identity and derived totals are computed incorrectly—unstable or missing item ids prevent quantity UI rendering, recursive add-to-cart overflows the call stack, and subtotal reduction ignores quantity, producing wrong totals or runtime crashes.