W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: [indexeddb] Calling update on a cursor index with a unique value constraint

From: Jeremy Orlow <jorlow@chromium.org>
Date: Wed, 6 Jul 2011 21:41:30 -0700
Message-ID: <CADBqD63XZ=sTvC=yY1LO2QYo+pCnG7dsPrpTjpNhpo=iAb54YA@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>, Adam Herchenroether <aherchen@microsoft.com>
On Wed, Jul 6, 2011 at 10:06 AM, Israel Hilerio <israelh@microsoft.com>wrote:

> What is the expected behavior when calling update() in a cursor index that
> requires unique values.  Firefox allows the update, even when it results in
> a duplicate value.  Chrome throws an error event with the code set to
> UNKNOWN_ERR.
>

Most (if not all?) of the times Chrome throws an UNKNOWN_ERR, it's because
the functionality simply hasn't been implemented yet.


> We believe an error should be thrown because of the violation of the unique
> value index constraint and the error code should be set to CONSTRAINT_ERR.
>  What do you think?
>

IIRC, we decided update should essentially be an alias to delete and then an
add on the parent object store--probably an atomic one.  So by that logic it
does seem to me CONSTRAINT_ERR would be the right error.

Btw, ObjectStore.add()'s exception section doesn't mention CONSTRAINT_ERR
though it probably should.

J
Received on Thursday, 7 July 2011 04:41:58 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:46 GMT