Let the server maintain canonical state while clients hold optimistic drafts. Each mutation carries a version, timestamp, and idempotency key to prevent duplication. When conflicts appear, the server decides with deterministic rules and returns a full cart snapshot, allowing clients to reconcile gracefully and display exactly what was saved without confusing jitter.
Merging carts across devices demands clear precedence. Prefer latest modification per line, sum compatible quantities, and split when variants differ. If promotions or inventory constraints invalidate choices, annotate affected lines with actionable guidance. Keep merge logic isolated, tested, and explainable, so customer support can understand outcomes and engineering can evolve policies confidently.
All Rights Reserved.