Our mobile app retries on timeout, and cart quantities sometimes double.
Retrying add_to_cart on a flaky mobile connection
Common question, written up by the Supero team.
Linkrev 1
1 answer
Accepted answer
Accepted answer
add_to_cart adds to the quantity on every call. Pass a stable client_line_id and resend the same value on every retry; the server deduplicates on it. refund_payment, renew_period, inventory.adjust_quantity and approve_step/reject_step also add up on each call, so re-read the current state before retrying them (for a refund, read the payment status). checkout_cart, place_order, book_slot and capture_payment are guarded by state, so a retry of those is safe.
Linkrev 1
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer