Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/dexie-cloud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dexie-cloud-addon",
"version": "4.4.9",
"version": "4.4.10",
"description": "Dexie addon that syncs with to Dexie Cloud",
"type": "module",
"module": "dist/modern/dexie-cloud-addon.js",
Expand Down
14 changes: 13 additions & 1 deletion addons/dexie-cloud/src/middlewares/blobResolveMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,20 @@ function createBlobResolvingCursor(
blobSavingQueue: BlobSavingQueue,
db: DexieCloudDB
): DBCoreCursor {
// Create wrapped cursor using Object.create() - inherits everything
// Create wrapped cursor using Object.create() - inherits everything.
// Important: .key and .primaryKey must be explicitly overridden with
// closure-based getters to prevent native IDBCursorWithValue getters from
// being reached through the prototype chain with a wrong `this`, which
// throws "Illegal invocation" in Chrome 146+.
const wrappedCursor = Object.create(cursor, {
key: {
get() { return cursor.key; },
configurable: true,
},
primaryKey: {
get() { return cursor.primaryKey; },
configurable: true,
},
value: {
value: cursor.value,
enumerable: true,
Expand Down
Loading