Closed michielbdejong closed 12 years ago
Actually the rev (not _rev) parameter is required all the time. Alternatively "_deleted": true (with a PUT) could be used, if the whole document is still available on the client. That way the code for "put" could be reused.
i hope this fixes it, needs testing still: https://github.com/unhosted/remoteStorage.js/commit/71f783ad7aa3530fd97b1f657907872369c49725#diff-1
looks good, will test in the evening. Thinking about it, I think a HEAD request would be enough to get the latest revision (in case of PUT the changes are ignored anyway, in case of DELETE there's really no reason to transmit all data again). With a HEAD request, the revision is sent along as ETag header.
good point!
On Wed, Mar 7, 2012 at 1:25 PM, niklas < reply@reply.github.com
wrote:
looks good, will test in the evening. Thinking about it, I think a HEAD request would be enough to get the latest revision (in case of PUT the changes are ignored anyway, in case of DELETE there's really no reason to transmit all data again). With a HEAD request, the revision is sent along as ETag header.
Reply to this email directly or view it on GitHub: https://github.com/unhosted/remoteStorage.js/issues/39#issuecomment-4367897
couch.js is gone, so this issue doesn't apply at the moment.
CouchDB can return a 409 on DELETE, we need to handle that and retry with the right _rev in there probably