Photos not uploading: thirty taken, one reached the office
Thirty handover photos were taken in the app and one reached the office, with no warning on screen. Completing the job before the photos were ready caused it.
Topic
What happens when the same thing arrives twice, and which of the two wins.
13 articles
Almost every article filed here starts the same way: something worked in testing and produced a duplicate in production. A payment provider sends two events for one payment. A queue redelivers. An operator reprocesses a batch. A client retries a request that had, in fact, succeeded. None of these are exotic, and a system that has not decided what it does about them has decided by accident.
The rule the collection keeps arriving at is that read-then-act is not a concurrency control, however careful the reading is. The condition has to be part of the write, and the caller that sees one affected row is the one allowed to continue. Everything else — uniqueness constraints, idempotency keys, replay-safe queues — is a backstop behind that.
Thirty handover photos were taken in the app and one reached the office, with no warning on screen. Completing the job before the photos were ready caused it.
Valid orders showed as rejected by the office after a server restart, because the app could not tell a failed connection from a refusal. How to check yours.
A lesson app showed a child one question of seven. A repeated create step and an unordered query combined, with no error. What to ask, and what we fixed.
Stock was taken off at order and again at dispatch, and partial dispatch let two drops ship the last unit. How to check why your stock count is wrong.
Two tills sold the last case and stock fell once because three code paths changed stock three ways. How to find why your stock does not match.
A driver with no signal got a spinner, not a delivery form. Offline capture existed but could not be reached. What should work offline, and what should not.
Field staff on poor signal can lose records or get the same ones on every refresh. A timestamp cursor is the usual cause. What to ask your supplier.
A rental app read a pending deposit as money received and told the driver nothing was owed. Why it happens, and an afternoon check to find it in your system.
One card payment was credited twice because two messages arrived 434 milliseconds apart, then the customer was asked for the deposit again. Cause and checks.
A customer paid the rental and a five thousand rupee deposit online, then was asked for five thousand more. Why the expected deposit read ten thousand.
Orders taken without signal showed as failed though saved, or vanished from the phone though refused. How to test your own order taking app, and what we fixed.
A counter charge and an upstream re-price both added 1,593 rupees an hour apart, and the ledger held back the customer's deposit. Why, and how to check.
Orders vanish or double when a field sales app loses signal. Three decisions to settle in writing before you commission or buy an offline sales app.