Bug 163285 - [REGRESSION] IDBObjectStore.get returns null for non-existent object rather than undefined
Summary: [REGRESSION] IDBObjectStore.get returns null for non-existent object rather t...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-10-11 09:08 PDT by Yingle
Modified: 2016-10-16 17:23 PDT (History)
4 users (show)

See Also:


Attachments
Test case that does *not* show the bug (692 bytes, text/html)
2016-10-14 14:42 PDT, Brady Eidson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yingle 2016-10-11 09:08:19 PDT
According to https://w3c.github.io/IndexedDB/#dom-idbobjectstore-get, IDBObjectStore.get should return undefined as result. In Safari 10, null is being returned instead and seems to be a regression.
Comment 1 Yingle 2016-10-11 10:48:40 PDT
This breaks existing web app that assumes undefined will be returned when the object does not exist in the object store. null is a defined value for object.
Comment 2 Radar WebKit Bug Importer 2016-10-11 17:48:50 PDT
<rdar://problem/28726701>
Comment 3 Brady Eidson 2016-10-14 14:24:39 PDT
This is yet another one where I'm shocked there's no relevant w3c test
Comment 4 Chris Dumez 2016-10-14 14:27:30 PDT
(In reply to comment #3)
> This is yet another one where I'm shocked there's no relevant w3c test

We only pass 80% of those IDB w3c tests last I checked.
Comment 5 Brady Eidson 2016-10-14 14:36:50 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > This is yet another one where I'm shocked there's no relevant w3c test
> 
> We only pass 80% of those IDB w3c tests last I checked.

There's tons of tests (I'm guessing ~20%) targeting IDB 2.0 features.

When you subtract out things we don't support, we should pass the suite.
Comment 6 Brady Eidson 2016-10-14 14:37:23 PDT
Regardless, I can't reproduce the bug reported here.

Attaching the test case I'm using that shows we correctly return undefined instead of null.
Comment 7 Brady Eidson 2016-10-14 14:42:25 PDT
Created attachment 291668 [details]
Test case that does *not* show the bug
Comment 8 Brady Eidson 2016-10-14 14:43:02 PDT
Please attach a test case that actually shows the bug.

We can't fix what we can't verify is broken.
Comment 9 Yingle 2016-10-15 12:07:37 PDT
Figured out the reason I got a null is because of another IndexedDB regression https://bugs.webkit.org/show_bug.cgi?id=162554. Also, I verified the problem has been fixed in Safari Technology Preview.
Sorry for confusion!
Comment 10 Brady Eidson 2016-10-16 17:23:26 PDT
(In reply to comment #9)
> Figured out the reason I got a null is because of another IndexedDB
> regression https://bugs.webkit.org/show_bug.cgi?id=162554. Also, I verified
> the problem has been fixed in Safari Technology Preview.
> Sorry for confusion!

Aha! Wasn't even an IndexedDB regression, but definitely affected IDB users!

Glad we have an explanation. I'll close the radar, too.