A .NET service updates Dataverse account rows through the Web API. To avoid overwriting other people's edits, it retrieves each row, stores the @odata.etag value, and later sends a PATCH with an If-Match header carrying that value. Some PATCH requests now fail with HTTP 412 Precondition Failed. What does the 412 response indicate, and how should the service respond?
Select an answer to reveal the explanation.
Short Explanation
Think of the ETag as a timestamp on the version you read. When you send If-Match and get 412, Dataverse is telling you somebody else saved the row after you looked at it, so your copy is stale. Don't blindly resend it; re-read, reapply your change, and try again.
Full Explanation
Optimistic concurrency in the Dataverse Web API works by comparing the ETag supplied in an If-Match header with the row's current version number. When they differ, the platform refuses the update with 412 Precondition Failed instead of silently overwriting a change made by another caller after the row was retrieved. The correct handling is to retrieve the row again, obtain its new ETag, re-evaluate or merge the intended change against the current values, and send the PATCH again with the fresh ETag. Treating the failure as throttling is wrong because service protection limits return 429 Too Many Requests with a Retry-After header, and resending the identical request with the same stale ETag would fail again. Moving the value into If-None-Match changes the meaning entirely: that header is used to prevent an upsert from updating an existing row or to request data only when it has changed, not to enforce concurrency on an update. A missing privilege produces an access-denied error (403-style fault), not a precondition failure, and no role change would make a stale ETag match. Exam caveat: If-Match: * is different; it only requires that the row exists and prevents an upsert from creating it. Operational check: log the ETag sent and the ETag returned by a fresh GET for a failed request; if they differ, the 412 is a genuine concurrency conflict.