Reproduce the lost change

Imagine a Budapest piano repair service with two office colleagues updating one visit request. Both open Tuesday’s appointment. One moves it to Wednesday; the other adds arrival instructions. If the second save sends the whole older form, it could restore Tuesday while appearing successful. Neither colleague deliberately asked for that result.

Write down which edits the app should preserve and which require review. Start with one shared record type and a repeatable two-session example. A notice that another person is editing can be helpful, but the save operation still needs protection when a tab has been open for a long time.

Check the version when saving

MDN describes If-Match as a condition that can reject an update when the record’s version no longer matches. Ask the developer to implement an equivalent guarded save on the server for the chosen system. The version check and write must work as one protected operation; checking only when the form opens leaves a gap.

When that check fails, explain that another change has arrived and that this attempt was not saved. Keep the person’s proposed edits available in the current editing session. Automatically refreshing the form into the latest version may remove exactly the text they need to resolve the disagreement.

Show what changed before asking for a choice

Present the original value, the value now saved and the person’s proposed value beside clear field names. For the repair service, staff should see Wednesday alongside their new instructions, rather than a generic error. Offer deliberate choices to retain the current value, apply their proposal or revise it after checking with a colleague.

Requiring review whenever a record changes is simpler to explain, but interrupts edits that may be compatible. Combining changes to separate fields can reduce interruptions, while adding rules and tests. Separate fields are not always independent: a changed visit date and a dated access instruction may still contradict each other. Validate the combined record against the business rules.

Keep retries separate from business decisions

Firestore’s documentation says a transaction may rerun when a concurrent edit changes data it read. That technical retry does not decide which appointment or instruction the staff intended. Specify conflict rules explicitly; do not assume a database feature supplies the review screen or preserves the meaning of an older form.

After staff resolve a conflict, protect the next save against further changes too. Another colleague could edit the record during the review. Make a second conflict understandable, retain the remaining proposal, and show the accepted result after success. Cancelling the review should not overwrite the current record; explain what happens to the unsaved draft.

Approve the behaviour with two sessions

Use two authorised test accounts or sessions and reopen the final record after each scenario. Compare its actual values with the agreed outcome, not just the confirmation message.

  • Open the same record twice, save one change, then submit the older form.
  • Change the same field differently and inspect the comparison shown.
  • Change separate fields, including a pair whose meanings depend on each other.
  • Verify that a conflict preserves the proposed text during resolution.
  • Make another edit while the comparison is open and try saving again.
  • Cancel the review and confirm the current record remains unchanged.

Sources and further reading

← Back to Insights