Bug 247613
Summary: | IBDIndex keyPath array with a single entry yielding incorrect key | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ivan Artemiev <ivaartem> |
Component: | Website Storage | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | cdumez, dima, sihui_liu, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 16 | ||
Hardware: | All | ||
OS: | All |
Ivan Artemiev
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/102364019>
Dima Goltsman
will this ever be fixed? thats a huge flaw!
Sihui Liu
*** This bug has been marked as a duplicate of bug 257238 ***
Chris Dumez
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
Awesome! Thanks for fixing the bug, Chris.