Stop double-click orders and duplicate submissions
People double-click. They tap again when nothing seems to happen, and they refresh in the middle of a payment. If your app creates two of something when that happens, the bug is yours even though they caused it.
How to check
- Open a form that creates something: an order, a sign-up, a comment.
- Fill it in and press the submit button five times, fast.
- Look at your data. There should be exactly one new record.
Fix it in the page
Disable the button as soon as it is pressed, and show that something is happening:
JavaScript
form.addEventListener("submit", () => {
button.disabled = true;
button.textContent = "Sending...";
});Re-enable it if the request fails so people can try again.
Fix it on the server too
The page fix is not enough, because a request can be sent twice by a retry, a slow network or two open tabs. The server should treat a repeat as the same request:
- Give each submission a unique key when the form loads, send it with the request, and ignore a second request with the same key. Many payment providers support this directly through an idempotency key.
- Add a uniqueness rule in the database where it makes sense, such as one account per email address.
- Make "create" actions safe to repeat, or check for a recent identical record.
Do not forget payment pages
Check the button that actually charges money first. A duplicate charge is the most expensive version of this bug. Use your payment provider's test mode to try it safely.
Want this checked on your app?
The free quick look presses submit-style buttons several times in a row in safe mode, where nothing is changed in your app, and reports what the page does. Checking what your server stores needs a test copy of your app.
We email you once when a spot opens. No spam, and you can ask us to remove you any time at support@appinvestigators.com.
Related guides
- Pre-launch checklist for an AI-built app
- How to test a vibe-coded app before you launch
- Show a message for empty search results and lost connections
Last updated 2026-11-24. This guide describes common problems and fixes. It is not a guarantee that any app is secure or free of bugs.