RESOLVED DUPLICATE of bug 257238 247613
IBDIndex keyPath array with a single entry yielding incorrect key
https://bugs.webkit.org/show_bug.cgi?id=247613
Summary IBDIndex keyPath array with a single entry yielding incorrect key
Ivan Artemiev
Reported 2022-11-08 05:35:22 PST
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.
Attachments
Radar WebKit Bug Importer
Comment 1 2022-11-15 05:36:15 PST
Dima Goltsman
Comment 2 2023-05-22 04:14:22 PDT
will this ever be fixed? thats a huge flaw!
Sihui Liu
Comment 3 2023-05-24 08:46:56 PDT
*** This bug has been marked as a duplicate of bug 257238 ***
Chris Dumez
Comment 4 2023-05-24 08:58:21 PDT
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.
Ivan Artemiev
Comment 5 2023-05-25 08:44:44 PDT
Awesome! Thanks for fixing the bug, Chris.
Note You need to log in before you can comment on or make changes to this bug.