[Webkit-unassigned] [Bug 60720] IndexedDB index does not enforce uniqueness

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 23 14:52:19 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=60720


Joshua Bell <jsbell at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID
                 CC|                            |jsbell at chromium.org




--- Comment #2 from Joshua Bell <jsbell at chromium.org>  2011-11-23 14:52:19 PST ---
The attached test is flawed - it's assuming that the index constraints are enforced synchronously during the add() operation and result in an exception being thrown. 

Per the spec, with the async API (which is what the test is using) the constraint is enforced asynchronously and the uniqueness constraint error is reported via the request object (i.e. the onerror handler will fire).

The test could be corrected with:

73d72
<     evalAndExpectException("objectStore.add({ name: 'Bob', height: 62, weight: 170 }, '237-23-7738');", "IDBDatabaseException.CONSTRAINT_ERR");
75c74,76
<     done();
---
>     req = evalAndLog("req = objectStore.add({ name: 'Bob', height: 62, weight: 170 }, '237-23-7738');", "IDBDatabaseException.CONSTRAINT_ERR");
>     req.onsuccess = unexpectedSuccessCallback;
>     req.onerror = done;

... but WebKit already has a test for this: LayoutTests/storage/indexeddb/index-unique.html

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list