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

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 UTC