Story #27 Conditional Requests · ETag Validation · Concurrency

The Update That Quietly Overwrote Someone Else's Changes

"Two users edited the same record. One change was silently lost"

Granite Facilities returned ETags with asset records but didn't require the If-Match header on updates. Concurrent edits from different users silently overwrote each other. Neither user nor the system had any indication that changes had been discarded.

What happened

Granite Facilities’ asset management API followed REST conventions and returned an ETag with every record response. The design intention was clear: clients should send the ETag back in an If-Match header when updating, allowing the server to reject stale updates.

In practice, the web application didn’t consistently include If-Match, and the API treated the header as optional even on update-sensitive paths. The server accepted every update request unconditionally.

A regional facilities manager opened an equipment record and began updating its maintenance schedule. At the same time, a technician opened the same record and changed the assigned technician. Both saved their changes. Both received HTTP 200. The last write silently won—whichever save completed second overrode the first without any error, warning, or audit trail.

The lost update wasn’t discovered until the wrong technician showed up on-site for a scheduled service. By then, the original change had been gone for days with no way to recover it.

Root cause

The API advertised ETags but didn’t enforce their use. The web application didn’t implement the concurrent-edit protection the API was designed to provide. No test submitted concurrent updates and verified that one was rejected.

The fix

The API was updated to require If-Match on all update operations for resources that could have concurrent editors. Requests without If-Match returned HTTP 428 (Precondition Required). The web application was updated to fetch the current ETag before submitting updates and to present a conflict resolution UI when it received HTTP 412.

Lesson learned

An ETag that isn’t enforced is documentation, not protection. If concurrent modification is possible, the API must require If-Match and return 412 on conflicts—not silently overwrite.

The Update That Quietly Overwrote Someone Else's Changes