[Webkit-unassigned] [Bug 247613] New: IBDIndex keyPath array with a single entry yielding incorrect key type

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 8 05:35:22 PST 2022


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

            Bug ID: 247613
           Summary: IBDIndex keyPath array with a single entry yielding
                    incorrect key type
           Product: WebKit
           Version: Safari 16
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Website Storage
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ivaartem at amazon.com
                CC: sihui_liu at apple.com

WPT: https://wpt.live/IndexedDB/idbindex_keyPath.any.html

Steps to reproduce:

const store = db.createObjectStore("store")
store.createIndex("byIdArrayKey", ["id"], { multiEntry: false }))

store.put({
  id: 1,
  title: "hello"
})

Expected behavior:
The index key that gets extracted from the record value should be [1] (array with a single subkey)

Actual results:
On WebKit this yield a scalar key with value 1 (number)
Confirmed on Safari 16 on macOS and iOS and Safari Tech Preview Release 156 (Safari 16.4, WebKit 17615.1.8.5)

An array keyPath should always produce an array key (https://www.w3.org/TR/IndexedDB/#evaluate-a-key-path-on-a-value)

Works as expected on V8 and SpiderMonkey
Note: single entry array keyPaths work as expected with IDBObjectStore on WebKit. The unexpected behavior is only observed with IDBIndex keyPaths.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221108/05dd4a3e/attachment.htm>


More information about the webkit-unassigned mailing list