How Do You Prevent Duplicate Submissions in a Mobile App?
To prevent duplicate submissions in a mobile app, combine a clear pending state with a server rule that recognises repeated attempts at the same action. Give each booking attempt a request identifier, keep that identifier when retrying, and return the existing result instead of creating another booking. If the connection disappears after submission, recover the booking status before inviting the user to start again.
Why is disabling the button only the first step?
For a booking flow, disable the confirmation button as soon as the user submits. Change its label to something clear, such as “Submitting booking”, and announce the status accessibly.
Treat this as feedback and an immediate guard against repeat taps. Specify server protection separately: repeated requests for the same booking attempt must resolve to one booking, including requests sent together.
Cover every route into submission. The button, keyboard action and any retry control should share the same submission logic. Avoid separate paths that each create a fresh booking attempt.
Map these transitions alongside the rest of the journey in your mobile app user flows. The flow should show what users see while waiting, after confirmation and when the outcome needs checking.
What should a request identifier represent?
Use a request identifier to represent one intended booking submission. It is separate from the booking reference, which identifies the booking created after acceptance.
Imagine a user choosing a service and appointment slot. When they confirm those details, create an identifier for that attempt and save it before sending the request. Send the identifier with the booking details.
Specify these rules:
- Repeating the same attempt uses the same identifier.
- Retrying after a timeout uses the same identifier.
- Reopening the app to recover an unresolved attempt preserves its identifier.
- Deliberately starting another booking creates a new identifier.
- Changing details after a definitive rejection starts a new attempt.
Do not generate a fresh identifier for every network request. That would describe each retry as a separate action.
Also avoid identifying duplicates solely by matching the customer, service and slot. Define any restriction on matching bookings as a separate business rule: a request identifier records intent, while booking eligibility decides what the business permits.
What must the server do with repeated attempts?
Ask for an explicit request-handling contract. For each identifier, the server should track the requesting account, submitted details, processing status and final outcome.
An accepted repeat should return the original booking reference and result. A request still being processed should return a pending status. Reusing an identifier with different booking details should produce a clear rejection, rather than silently accepting the changed request.
Require concurrent requests to claim the identifier through one protected operation. Recording it only after creating the booking leaves the design without a defined safeguard during processing.
The contract should also cover interrupted processing: specify how the system resumes or reconciles an attempt if booking creation succeeds before its final status is recorded.
This behaviour is often called idempotency. For this booking flow, make its acceptance condition concrete: repeated submissions of one attempt produce one booking and a consistent result.
Keep access checks in place for every retry and status lookup. An identifier must not grant permission to view someone else's booking.
How should safe retries work?
Separate a retry from a new booking. A retry asks the system to finish or report the outcome of an existing attempt.
Use a defined retry policy, with delays between attempts and a stopping point. Keep the original identifier and booking details throughout. After automatic retries stop, give the user a visible recovery action such as “Check booking status”.
Do not automatically retry a definitive rejection. If the slot is unavailable, show that result and let the user choose another slot. Once they confirm revised details, begin a new attempt.
Agree how long the server retains request records and how long the app may retry them. When an attempt falls outside that supported window, require reconciliation through booking history or support rather than silently submitting it again.
If bookings can be queued without a connection, define that behaviour in your offline data sync plan. Queued should mean waiting to submit, never confirmed.
Which pending and recovery states should users see?
Use states that describe what the system knows. Keep “submission failed” separate from “confirmation has not arrived”.
| State | Suggested message | Available action |
|---|---|---|
| Ready | Review your booking | Confirm booking |
| Submitting | Submitting your booking | Wait |
| Outcome unknown | We could not confirm your booking status | Check booking status |
| Confirmed | Your booking is confirmed | View booking |
| Rejected | This slot is no longer available | Choose another slot |
These messages are illustrative and should match the product's terminology.
In the outcome-unknown state, retain the selected details and unresolved attempt. Avoid presenting an unrestricted “Book again” action before checking its status.
Keep the state recoverable when the user leaves the screen. On return, show the unresolved booking and offer to check it. Use the same status language in booking history so users do not have to interpret conflicting messages.
Plan these screens with your loading, empty and error states, including accessible status announcements and a useful next action.
What happens when the connection is lost after submission?
Consider this illustrative booking sequence:
- The user confirms an appointment.
- The app saves an attempt identifier and sends the request.
- The server creates the booking and records its reference.
- The connection drops before the app receives confirmation.
- The app shows an unresolved status and retains the attempt.
- A status check or retry with the same identifier retrieves the confirmed booking.
For this scenario, require the recovered screen to show the original booking reference and selected appointment. It must not create another booking.
If the original request is still processing, keep the attempt pending. If the server definitively rejected it, show the reason and the appropriate next step.
Make the confirmation available through booking history as well. A user who closes and reopens the app should have a clear route back to the result.
What acceptance checks should you require?
Write checks around visible outcomes and saved records. A disabled button alone is insufficient evidence.
- Double tap: Tap confirmation rapidly. Expect one booking and one booking reference.
- Concurrent requests: Send the same attempt together. Expect one booking, with consistent responses or a temporary pending result.
- Lost confirmation: Allow booking creation, then interrupt the response. Recover the original booking without another record.
- App restart: Close the app during submission. Reopen it and recover the unresolved attempt.
- Changed details: Reuse an identifier with a different slot. Expect rejection without a changed or additional booking.
- Account separation: Request another account's attempt status. Expect access to be denied.
- Expired attempt: Retry outside the supported window. Expect a recovery path without silent resubmission.
- Legitimate new booking: Complete one booking, then deliberately start another permitted booking. Expect a new attempt.
Include booking-triggered messages in verification. Require repeated processing of the same attempt to avoid sending duplicate confirmations.
Add these scenarios to your Android app testing plan, including checks after leaving the booking screen.
What common mistakes should you avoid?
Avoid clearing the attempt as soon as the app loses its connection. Retain it until the outcome is resolved or an explicit recovery process takes over.
Avoid treating a timeout as a definitive rejection. For the booking flow described here, use the unresolved state until the server provides an authoritative result.
Do not mark a booking confirmed merely because the request was sent. Require a confirmed server result and booking reference.
Finally, keep duplicate protection separate from availability rules. Recognising one repeated attempt does not decide whether two different customers may reserve the same slot. Specify and test that restriction independently.
What else do product owners ask?
Should every button use a request identifier?
Prioritise actions that create records or trigger consequences, such as bookings and payments. Define duplicate protection around the action being performed.
Should a retry get a new identifier?
No. Keep the same identifier for the same unresolved attempt. Use a new one when the user deliberately starts a new action.
Can the app show an error and let the user try again?
Yes, when the outcome is a definitive rejection. When the outcome is unknown, offer status recovery or a retry tied to the original attempt.
Does this also prevent duplicate charges?
Include charging in its own explicit contract. If booking includes payment, define how retries recover both outcomes, and test them together before release. Our guide on testing a mobile app on slow and unstable networks shows how to recreate retries and timeouts.