Two coordinators open the same volunteer rota. One changes a shift's location while the other corrects its supervisor. Both save successfully, yet the location returns to its previous value. The second screen submitted an older copy of the record and replaced the first person's change. Optimistic concurrency control makes that conflict visible before a stale write is accepted.
This is a common problem in shared administrative software because opening a form and saving it are separate moments. A lock held throughout the editing session may be inconvenient or impractical. A version check instead asks whether the record is still the version the person originally reviewed.
Put a version in the editing contract
For a fictional volunteer coordination service, return a record version with the rota details. When the editor saves, include that version as a precondition. The server must compare it and perform the update as one controlled operation. A comparison followed by an unrelated write leaves another gap in which the record can change.
The version can be implemented using the application's database facilities and exposed through an appropriate API contract. MDN's If-Match documentation describes HTTP conditional requests using entity tags. A failed precondition can be reported with HTTP 412. Choose a consistent contract rather than making each screen invent its own conflict signal.
Do not use a timestamp displayed to the nearest second as a casual substitute for a reliable version. Distinct writes can occur inside that interval, and display formatting is not an identity guarantee. The implementation needs a value that represents the authoritative revision being compared.
Preserve the attempted changes on conflict
When a precondition fails, retain the editor's draft. Show that someone changed the rota after it was opened, and provide the latest record alongside the attempted values where appropriate. Clearing the form merely replaces silent data loss with visible frustration.
For the volunteer example, the system can show that the venue changed while the supervisor field was being edited. Let the coordinator review the difference and decide whether to apply their correction to the latest version. Refreshing automatically and resubmitting without review defeats the purpose of detecting the conflict.
Be precise about the choices. Reload current record may discard a local draft; review changes should preserve it. If an override exists, make its effect and permissions explicit. A button labeled save anyway should not secretly replace fields the person never intended to touch.
Decide which changes can merge safely
Field-level updates can reduce accidental overwrites, but different fields are not always independent. A shift's venue and available equipment may need to remain consistent. Automatically merging them because their field names differ can produce a combination nobody approved.
Define merge rules around business meaning. Independent descriptive notes might be preserved as separate contributions. A capacity and an accepted-attendee count need an authoritative rule. The product team should supply examples of combinations that can merge and combinations that require human review.
Also distinguish editing from commands. Accepting a place, closing a shift or approving an expense may have a specific transition precondition beyond a generic record version. The server must enforce that rule even if a client submits a technically current revision.
Test the overlap deliberately
Open the same rota in two sessions. Save different edits, then conflicting edits, and inspect the final record and both interfaces. Include a retry after a response timeout and a conflict discovered after the editor's session expires. Each case should preserve an understandable account of what happened.
During business software development, agree on conflict handling before adding a final success toast. A trustworthy save means the system accepted the intended change against a known state. It should never require staff to discover overwritten work by comparing memories after the event.



