FM-027 Authorization, Localization, and HTTP Semantics

Concurrent Update and Lost-Update Failures

Two consumers independently update the same resource; the second silently overwrites the first without ETag or conditional-request enforcement.

Failure explanation

Two clients read the same resource and then submit updates based on the same old version. If the server accepts both without concurrency control, the later write can overwrite the earlier one. The user may lose edits without any indication. Optimistic concurrency commonly uses ETag with If-Match; other designs may use version fields or explicit conflict detection.

Example

A manager reads an asset with status AVAILABLE. A technician changes it to IN_REPAIR. The manager later submits a stale full-resource update that sets the status back to AVAILABLE, unintentionally undoing the technician’s change.

How to test

  • Read the same resource from two clients.
  • Update it from client A, then submit client B’s stale version.
  • Test missing, valid, and stale If-Match values and concurrent requests.
  • Verify atomicity of version checks and update operations.

Expected behavior

The server rejects stale writes with the documented conflict/precondition response, such as 412 for a failed If-Match condition, or applies another explicit conflict policy. No update should be silently lost.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.