[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GET before PUT on an EditURI



On Wed, 14 Jul 2004 00:49:14 -0400, Mark Baker <distobj@xxxxxxx> wrote:
> On Tue, Jul 13, 2004 at 10:26:14PM -0400, Joe Gregorio wrote:
> >
> > On Tue, 13 Jul 2004 15:26:51 -0700, Tim Bray <tim.bray@xxxxxxx> wrote:
> > > [page 5/sect 3.2] the description reads like it's forbidden to do a PUT
> > > without doing a GET first.  Is this true?  If I know the URI and I know
> > > what I want to put there, can't I just blast it in?
> >
> > You could, but you might not want to.
> >
> > Consider the case of a Wiki. Most Wiki HTML editing forms have
> > a nonce, either a hidden time or a hash value. This nonce is used
> > to protect against edits being lost in a race condition, i.e. user
> > A starts to edit a page, takes too long and later user B edits the
> > same page and commits before user A does.
> >
> > If the client does a GET on the EditURI then the server has a chance
> > to place a nonce in the entry. The client should preserve
> > that nonce and submit it with the entry when the edit entry
> > is PUT back to the EditURI.
> > 
> > For this scenario to work [...]
> 
> By "work", do you mean;
> 
> 1. user A is notified of a problem when they try to PUT? ... or
> 2. user B is denied the ability to PUT because A is editing it?
> 
> If #1, I suggest that [1] would suffice to detect the conflict.
> If #2, perhaps WebDAV LOCK should be considered.
> 
> But in both cases, a PUT without a preceding GET is not a problem.
> 
>  [1] http://www.w3.org/1999/04/Editing/

This does lead to a question of documentation. Should 
detection of lost updates when using the Atom Publishing 
Protocol be written into the spec? I don't believe
that every Atom server MUST support it, just that
*if* they are going to support detecting lost updates
than this is how you do it interoperably.

For example, a new section on Detecting Lost Updates 
could be added that covered that material
in http://www.w3.org/1999/04/Editing/
specifically applied to the EditURI.

    Thanks,
    -joe