Subject: [Simple] [XCAP] Idempotency is not possible for DELETE request when using "by-pos" to delete a node

From: Iñaki Baz Castillo <[email-masked]>
Date: Thu, 3 Dec 2009 18:19:41 +0100

Hi, RFC 4825 says (page 24):
   
   HTTP also specifies that PUT and DELETE requests are idempotent.
   This means that, if the client performs a PUT on a document and it
   succeeds, it can perform the same PUT, and the resulting document
   will look the same.  Similarly, when a client performs a DELETE, if
   it succeeds, a subsequent DELETE to the same URI will generate a 404;
   the resource no longer exists on the server since it was deleted by
   the previous DELETE operation. To maintain this property, the client
   SHOULD construct its URIs such that, after the modification has taken
   place, the URI in the request will point to the resource just
   inserted for PUT (i.e., the body of the request), and will point to
   nothing for DELETE.

But this is not possible for DELETE requests when selecting the node to delete 
using "by-pos":

  by-pos                 = NameorAny "[" position "]"

Imagine a node "<parent>" containing various "<child>" nodes. A client 
performs a DELETE request for the second <child> node:

  DELETE  /auid/xui/sip:[email-masked]/index/~~/parent/child[2]  HTTP/1.1

This request will delete the second <child> node.
If the clients repeats the same DELETE request it will delete the current 
second <child> nod rather than "nothing" as "Idempotency" concept states in 
RFC 4825.

So? is it a bug in the specification? or do I miss something?

Regards.

-- 
Iñaki Baz Castillo <[email-masked]>

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Fri, 4 Dec 2009 00:45:04 +0100

El Jueves, 3 de Diciembre de 2009, Iñaki Baz Castillo escribió:
> But this is not possible for DELETE requests when selecting the node to
>  delete using "by-pos":
> 

Yes, I missed something:

 7.5.  Delete an Element
   [...]
   Positional deletions without using a unique attribute name and value
   are possible, but only in limited cases where idempotency is
   guaranteed.  In particular, if a DELETE operation refers to an
   element by name and position alone (parent/elname[n]), this is
   permitted only when the element to be deleted is the last element
   amongst all its siblings with that name.  Similarly, if a DELETE
   operation refers to an element by position alone (parent/*[n]), this
   is permitted only when the element to be deleted is the last amongst
   all sibling elements, regardless of name.

However I don't like this rule, I don't consider it useful at all.