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.
<rdar://problem/102364019>
will this ever be fixed? thats a huge flaw!
*** This bug has been marked as a duplicate of bug 257238 ***
Good job adding a web-platform-test Ivan :) This is how I became aware of this issue and decided to fix it in https://github.com/WebKit/WebKit/pull/14269.
Awesome! Thanks for fixing the bug, Chris.