Engineering notes

Rechecking a browser bag at checkout

Persist user selections, then refresh authoritative purchase data when those selections become a cart.

A browser bag can survive a reload while the catalog changes around it. Stored selections therefore describe what someone chose, not what remains purchasable.

DeskLab saves catalog product IDs and quantities. Shared configurations also exclude prices. Their decoder accepts known IDs, bounded quantities and validated preferences, but treats the encoded data as editable input.

At checkout, the server resolves those catalog IDs to live Shopify variants. It rechecks availability and quantities before submitting merchandise lines. Shopify's cart API takes merchandise IDs and returns a checkout URL, along with errors and warnings that the integration must inspect.

DeskLab also compares the returned cart with the requested lines. Warnings or changed quantities produce an error rather than sending someone to a silently reduced cart.

The recheck does not reserve stock. Hosted checkout remains authoritative, and returning to the storefront does not itself establish payment success. DeskLab uses fictional merchandise and test payments; its example demonstrates a concrete boundary between persistent browser state and a fresh server-side purchase request.

Inspect DeskLab's browser-to-checkout boundaries

All engineering notes