Skip to content

A booking request times out. Can the client assume it failed?

1 min read · main part only; folded sections are optional

After this you can answer: A booking request times out. Can the client assume it failed?

There are several possible timelines: the request never reached the API, the transaction rolled back, or it committed and the response disappeared. The browser cannot distinguish them from a network error alone. Sending the same parameters with the same user-scoped key makes that distinction unnecessary for correctness.

The retry helper permits two retries, giving at most three attempts. A 4xx response is not automatically retried. A 5xx or missing HTTP status may be ambiguous, so the idempotency contract makes those retries safe. This is specific to booking; arbitrary mutations should not gain retries by default.

Backoff limits immediate load, but it cannot prove completion. After retries are exhausted, the product should let the customer reconcile their booking rather than state that nothing happened. My tickets is a useful recovery view, while a durable intent history would strengthen recovery across a browser restart.

Why not retry with a new key?
A new key means a new booking intent to the server. If the first request committed, that retry could buy seats twice.
What if the server returns 409?
The helper stops. The user may have requested unavailable seats or reused a key with different parameters. Repeating automatically does not resolve that decision.
Would a longer timeout fix this?
It may reduce some ambiguous responses while keeping callers waiting longer. It cannot remove the interval between commit and receipt of the response, so idempotency remains necessary.

Read Idempotency, then inspect the api-app piece →.

apps/web/src/features/bookings/lib/booking-retry.ts → shouldRetryBooking

Read this book online: https://book.theversehub.in/