DEV Community

Discussion on: A 200 OK can still belong to the wrong input

Collapse
 
_firelinks profile image
Mike Dabydeen •

The revision gate covers stale rendering; the final paragraph correctly draws the boundary at server-side effects. I would make that boundary visible in the example with a quote ID carried from the result to the purchase and an idempotency key on the mutation. Then the tests can assert two separate properties: stale UI never renders, and a repeated purchase request cannot create two side effects. That separation keeps the client revision counter from being mistaken for authorization or deduplication. The eleven tests exercise the first class well. Is a server mutation example planned as a follow-up?

Collapse
 
bryanw profile image
Bryan Williams CivicDataForge •

Thanks, Mike—that’s a useful direction for a follow-up. I kept this example focused on which request may update the screen, so the client-side rule stayed easy to follow.

Your quote-to-purchase example would make the next boundary concrete: the server validates the quote’s ownership, scope, and expiry, while idempotency handles retries without duplicating the purchase. Neither guarantee comes from the revision counter.

I’ll cover this in a separate post soon, with its own runnable example and tests for retries, concurrent requests, and invalid or expired quotes. It deserves that space rather than being squeezed into this one. Appreciate the thoughtful suggestion!