This project is archived and is in readonly mode.

#655 ✓stale
Tim Olsen

ActiveResource PUT is subject to lost updates

Reported by Tim Olsen | July 18th, 2008 @ 10:50 PM | in 2.x

Rails is going to the trouble now of publishing etags but they are not being used by ActiveResource's PUT to prevent lost updates.

For example,

client A GETs Resource X (etag 1)

client B GETs Resource X (etag 1)

client A PUTs Resource X (new etag 2)

client B PUTs Resource X (new etag 3)

client B has overwritten A's changes silently

ActiveResource should be sending If-Match: "etag" which should fail with 412 if the etag has already changed.

etags are also useful with DELETE and GET in the case of #reload()

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket