Closed Bug 1573325 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 18396 - Indexed DB: Fix compound index keys vs. autoincrement stores

Categories

(Core :: Storage: IndexedDB, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 18396 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/18396
Details from upstream follow.

Joshua Bell <jsbell@chromium.org> wrote:

Indexed DB: Fix compound index keys vs. autoincrement stores

Stores with (1) a keyPath (a.k.a. inline keys) and (2) autoIncrement
(a.k.a. a key generator) have primary keys generated by the browser
and inserted into objects lazily, since the renderer doesn't know what
the primary keys will be when the object is serialized.

Indexes might have a keyPath that references the same spot in the
object. This is handled by checking if the keypaths match. If so,
the browser synthesizes the index key (same as the primary key). But
Chrome was not handling the case where the index had a compound
key - a keypath that's an array, plucking multiple values out of
the object. An object with unresolved keypaths would normally just
not be indexed, per spec. But since the primary keys should be injected
before the indexing occurs, these should be indexed.

Fix this by sending the index keys from the renderer to the browser
as an array with "holes" that need to be filled in.

This is covered by an existing Web Platform Test, which we now pass.

Bug: 701972
Change-Id: I14940b23cfcbb7f8b673143b402f574220184fd7
Reviewed-on: https://chromium-review.googlesource.com/1728058
WPT-Export-Revision: 14f50dba482b4f895e3a9132525fcab4507e4bee

Component: web-platform-tests → DOM: IndexedDB
Product: Testing → Core
Ran 1 tests and 3 subtests
OK     : 1
PASS   : 1
FAIL   : 2

New tests that have failures or other problems:
/IndexedDB/idbobjectstore_createIndex15-autoincrement.htm
    Auto-Increment Primary Key - invalid key values elsewhere: FAIL
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f84684870ef5
[wpt PR 18396] - Indexed DB: Fix compound index keys vs. autoincrement stores, a=testonly
https://hg.mozilla.org/integration/mozilla-inbound/rev/a581df60f6af
[wpt PR 18396] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.