Find the real conflict

Imagine a service desk record with a delivery address, contact number and promised visit date. Mei opens it at 10:00. Arun opens the same record a minute later. Mei corrects the number and saves; Arun changes the visit date on his older screen and saves at 10:03. If Arun sends the entire old record and the server simply replaces the row, Mei’s correction disappears although both people saw a success message. This is a lost update. The business cost is not measured by how often the Save button is clicked; it appears when a customer is called at the wrong number, a team follows an obsolete instruction, or staff cannot explain which value was accepted.

Start by identifying which records genuinely have simultaneous editors and which fields matter to a real decision. A shared customer note may tolerate appended comments, while a booking time, refund state or shipping address needs a stronger rule. Ask staff to walk through their current behavior: do they keep an edit tab open, copy data into a spreadsheet, or assume a colleague will warn them? Do not use a short automatic refresh as the only safeguard. It can update the screen before editing, but another save can still land between the refresh and the submit. The server must arbitrate the final write against its current state.

Attach a version to the viewed record

A practical design gives each representation a version token when it is read. For an HTTP resource, a strong ETag can identify the current representation; a client that updates it sends that tag in If-Match. RFC 9110 says the origin server uses strong comparison for If-Match and evaluates the condition just before applying the requested change. If the tag no longer matches, the normal result is 412 Precondition Failed. A service may require a conditional request and use 428 Precondition Required when the editor omits it. These codes have different meanings: 428 asks the client to supply a condition; 412 says the supplied condition failed. The user interface should translate both into a useful action rather than display a bare number.

The tag is a comparison token, not an invitation to parse a timestamp or assume that two versions are close enough. A weak ETag is unsuitable for If-Match because this precondition is intended to catch representation changes. If the application is not exposing HTTP resources directly, the same principle can be implemented with a database version column: update the row only when its stored version still equals the version read by the editor, and increment that version in the same transaction. The essential property is atomicity. A separate “check version” query followed later by an unconditional update recreates the race. Record identity and authorization must still be checked; a matching version does not grant permission to edit someone else’s record.

Let people resolve the conflict

When a condition fails, preserve the editor’s unsaved input and fetch the latest server record. Show the two versions with field names, not an undifferentiated error banner. In the example, the operator should see Mei’s new phone number and Arun’s proposed visit date. If they affect separate fields, the interface can offer a fresh draft containing both, but it should still ask for review and submit against the latest version. If both people changed the visit date, the system cannot know which promise was communicated to the customer. Give staff a way to check the underlying conversation, choose the correct value, and explain the decision. Never silently replay the old full payload after a 412.

Consider the difference between replacing a record and applying a narrow operation. A full record replacement is easy to reason about but can overwrite unrelated fields if it lacks a precondition. A field-level patch may reduce unnecessary conflicts, yet it still needs a rule when two editors touch the same field or when fields depend on each other. For example, a delivery address and delivery zone may have to change together. Model those invariants on the server and decide whether a failed save leaves a draft, offers a merge, or requires a supervisor. Present the current accepted state prominently. A draft is not a confirmed change, and a failed save must not trigger downstream notifications as though it succeeded.

Test the whole staff journey

A useful acceptance test uses two independent sessions. Both read version A. Editor one changes the contact number and successfully saves version B. Editor two then attempts to save a date change with version A; the server must reject that stale update, retain version B, and show editor two both the latest value and their unsaved proposal. After review, editor two submits against version B, creating version C. Repeat with both editors changing the same field, with a browser tab left open overnight, and with an omitted condition. Verify the database, audit event and customer-facing state, not only the toast message. If the record can also be changed by a batch import or partner API, include that writer in the test.

There are two operational questions to settle before rollout. First, who may decide a conflict when one edit has already caused a customer commitment? A technical merge cannot replace a business owner’s judgment. Second, how will support identify which save was rejected and which version became authoritative? Keep a change record that distinguishes attempts from accepted changes, with actor, time, record identifier and outcome. Avoid copying sensitive whole records into a general error log. Review conflict frequency after launch as a local operational signal, then improve the affected workflow. The HTTP status itself proves only what happened to that request; it does not prove the overall process is safe until the staff can recover without losing work.

Choose a rollout that staff can trust

Before switching the rule on, make a list of every route that can change the protected record: the ordinary edit page, mobile view, bulk upload, an administrator correction screen, and background integrations. A single unconditional route can defeat the promise made by the other screens. Decide whether each route uses the same version check, submits a deliberate operation with a separate business rule, or is restricted to a named role. Document the owner of that decision. For old clients that cannot send a condition, an explicit 428 is easier to diagnose than accepting the unsafe write. A staged rollout can start on one low-risk record type while staff practice resolving a conflict. Measure actual rejected attempts and support reports locally before extending it to order or payment records.

The response shown to staff should make the boundary clear. “Your changes were not saved because this record changed” is accurate; “another user changed it” may be too narrow when an import or automated process did the work. Offer a comparison, a way to copy a draft, and a fresh save action after review. If the user closes the page, decide whether the unsaved draft can be recovered and how long it should be kept. That retention choice depends on the sensitivity of the record and the organization’s own policy; do not put personal details into an indefinitely retained browser cache merely for convenience. Make the conflict message accessible to keyboard and screen-reader users and place focus where the next action can be found.

Finally, separate a conflict from a transport failure. A timeout after Save does not prove the write failed; the server may have accepted it while the response was lost. Fetch the current record and its version before asking staff to retry. If the intended change is present, show the accepted state. If it is absent, let the staff submit again against the latest version after checking for a concurrent change. Where saving also triggers an external action, such as an email or fulfilment instruction, coordinate that action with the accepted record transition so a retry does not send contradictory messages. This extra step prevents a well-designed version check from being undermined by the surrounding workflow.

Before you proceed

  • Can two staff sessions edit the same record without a silent overwrite?
  • Does a rejected save preserve the proposed change and show the current accepted value?
  • Are missing and stale version conditions handled separately?

Sources & further reading