WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
149107
IndexedDB does not throw ConstraintErrors for unique keys
https://bugs.webkit.org/show_bug.cgi?id=149107
Summary
IndexedDB does not throw ConstraintErrors for unique keys
Nolan Lawson
Reported
2015-09-13 12:45:50 PDT
Created
attachment 261088
[details]
Reproducible test case (May be a dup of
https://bugs.webkit.org/show_bug.cgi?id=60720
, but it was marked as invalid because they didn't have a good reproducible test case.) In WebKit Nightly 600.8.9 (as well as Safari 8.0.8), it is possible to put() two documents with the same key, even if that key is defined as a unique index. I have a reproducible test case to demonstrate:
http://bl.ocks.org/nolanlawson/28ff2db3f3cb386c8ecb
. The same test is also attached to this bug. If the bug has been successfully reproduced, then this HTML page will print "There is a bug." Note that openKeyCursor() also returns the same key twice. This bug cannot be reproduced in either Firefox or Chrome.
Attachments
Reproducible test case
(1.86 KB, text/html)
2015-09-13 12:45 PDT
,
Nolan Lawson
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Dmitry Sorin
Comment 1
2016-03-04 14:24:57 PST
+1 for this bug. Reproducable.
Brady Eidson
Comment 2
2016-03-04 14:42:52 PST
Good thing this is fixed in Modern IDB! Works great in ToT/WebKit nightly.
Dmitry Sorin
Comment 3
2016-03-04 14:43:58 PST
Will Safari9 in OSX 10.11 get this update?
Brady Eidson
Comment 4
2016-03-04 14:46:45 PST
(In reply to
comment #3
)
> Will Safari9 in OSX 10.11 get this update?
This is the WebKit open source project. Safari is an Apple product, and Apple generally does not comment on their future products.
Dmitry Sorin
Comment 5
2016-03-04 14:50:53 PST
Generally !== always, huh? :) Not in this Safari version, right?
Brady Eidson
Comment 6
2016-03-04 14:58:20 PST
(In reply to
comment #5
)
> Generally !== always, huh? :) > Not in this Safari version, right?
I'm not sure what you're trying to clarify. This should be working for you in whatever relatively modern Safari version you have + a WebKit nightly.
Dmitry Sorin
Comment 7
2016-03-04 15:29:48 PST
Okay, thank you
Nolan Lawson
Comment 8
2016-03-21 08:29:57 PDT
Nice to see progress getting made on this! :) Unfortunately I tested my demo site (
http://bl.ocks.org/nolanlawson/28ff2db3f3cb386c8ecb
) on WebKit Nightly (10601.5.17.1.1,
r195011
) and it seems to still be broken. (It says "there is a bug.") Was this closed too early or is there some other reason the test case is failing?
Brady Eidson
Comment 9
2016-03-21 09:30:35 PDT
(In reply to
comment #8
)
> Was this closed too early or is there some other reason the test > case is failing?
Unclear. I see the same with the attached test case (but did not on 3/4) I'll poke around using the attached test case.
Brady Eidson
Comment 10
2016-03-21 11:21:43 PDT
Odd. I reproduced this in the latest WebKit nightly, but it works fine in my local build of ToT.
Brady Eidson
Comment 11
2016-03-21 11:27:02 PDT
(In reply to
comment #10
)
> Odd. > > I reproduced this in the latest WebKit nightly, but it works fine in my > local build of ToT.
Nope, bonehead - I did *not* reproduce with a WebKit nightly. I was using stock Safari. So, to clarify - I cannot reproduce this being broken. In nightly 198484 (
r198484
.dmg">http://builds.nightly.webkit.org/files/trunk/mac/WebKit-SVN-
r198484
.dmg) and a ToT debug build, the attached test case works fine. ---- If you see the text There is a bug, then there's a bug. Got a ConstraintError when we tried to put() the same key twice Found keys: a Found primaryKeys: 1
Brady Eidson
Comment 12
2016-03-21 11:30:37 PDT
(In reply to
comment #8
) Oh I see:
> Unfortunately I tested my demo site > (
http://bl.ocks.org/nolanlawson/28ff2db3f3cb386c8ecb
) on WebKit Nightly > (10601.5.17.1.1,
r195011
) and it seems to still be broken. (It says "there > is a bug.") Was this closed too early or is there some other reason the test > case is failing?
Nightly 195011 is ancient. January 14th was well before the new engine was enabled in WebKit2, which is what Safari (and therefore WebKit nightlies) uses. Try with the latest nightly, please.
Brady Eidson
Comment 13
2016-03-21 11:32:00 PDT
(In reply to
comment #12
)
> (In reply to
comment #8
) > > Oh I see: > > > Unfortunately I tested my demo site > > (
http://bl.ocks.org/nolanlawson/28ff2db3f3cb386c8ecb
) on WebKit Nightly > > (10601.5.17.1.1,
r195011
) and it seems to still be broken. (It says "there > > is a bug.") Was this closed too early or is there some other reason the test > > case is failing? > > Nightly 195011 is ancient. > > January 14th was well before the new engine was enabled in WebKit2, which is > what Safari (and therefore WebKit nightlies) uses. > > Try with the latest nightly, please.
For the historical record: Modern IDB wasn't enabled in WK2 until
http://trac.webkit.org/changeset/197122
, and there were still some pretty bad bugs with it for another ~1 week after that.
Nolan Lawson
Comment 14
2016-03-21 13:57:41 PDT
My bad! It is indeed fixed. Somehow I got stuck with an old version of WebKit Nightly, but re-downloading worked. :) I'm on
r198490
. Also a big thank-you for your work on "modern IDB"! Love seeing all these IDB bugs slowly getting knocked down.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug