From 72dbce9a08c8a1a4e3467fe7e3a42da0d6aa207a Mon Sep 17 00:00:00 2001 From: ldm0 Date: Wed, 28 Oct 2026 07:42:15 +0800 Subject: [PATCH] fix(indexeddb): complete native key and upgrade handle integration Create requests after key conversion and reject transactions invalidated by author code. Preserve transaction-owned wrapper identities across borrowed methods and keep the stronger key-range regression coverage. --- .../tests/web_apis/fixtures/indexeddb-upgrade-handles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moli-core/tests/web_apis/fixtures/indexeddb-upgrade-handles.js b/moli-core/tests/web_apis/fixtures/indexeddb-upgrade-handles.js index 66e505fa899..87f57453c0e 100644 --- a/moli-core/tests/web_apis/fixtures/indexeddb-upgrade-handles.js +++ b/moli-core/tests/web_apis/fixtures/indexeddb-upgrade-handles.js @@ -23,7 +23,7 @@ async function upgradeHandleProbe(name = 'upgrade-handles-' + Math.random()) { db = opening.result; tx = opening.transaction; store = tx.objectStore('s'); alias = peer.IDBTransaction.prototype.objectStore.call(tx, 's'); - if (frame) check('borrowed method preserves wrapper creation realm', Object.getPrototypeOf(alias) === peer.IDBObjectStore.prototype); + if (frame) check('borrowed method preserves transaction object identity and realm', alias === store && Object.getPrototypeOf(alias) === IDBObjectStore.prototype); for (const source of [store, alias]) equal('initial index names', Array.from(source.indexNames), ['old']); indexes = [store.index('old'), alias.index('old'), peer.IDBObjectStore.prototype.index.call(store, 'old'), @@ -38,7 +38,7 @@ async function upgradeHandleProbe(name = 'upgrade-handles-' + Math.random()) { check('new index is immediately found', source.index('transient').name === 'transient'); } check('local metadata keeps receiver realm', Object.getPrototypeOf(store.indexNames) === DOMStringList.prototype); - check('foreign metadata keeps receiver realm', Object.getPrototypeOf(alias.indexNames) === peer.DOMStringList.prototype); + check('borrowed method metadata keeps transaction realm', Object.getPrototypeOf(alias.indexNames) === DOMStringList.prototype); store.deleteIndex('old'); for (const index of indexes) equal('deleteIndex invalidates all index realms', errorName(() => index.get(1)), 'InvalidStateError'); for (const source of [store, alias]) equal('deleted index lookup', errorName(() => source.index('old')), 'NotFoundError');