dexie-cloud-addon 4.4.9 → 4.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.4.9, Tue Mar 31 2026
11
+ * Version 4.4.11, Sun Apr 19 2026
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -6204,8 +6204,20 @@ function createBlobResolveMiddleware(db) {
6204
6204
  * each onNext callback, ensuring cursor.value is always available.
6205
6205
  */
6206
6206
  function createBlobResolvingCursor(cursor, table, blobSavingQueue, db) {
6207
- // Create wrapped cursor using Object.create() - inherits everything
6207
+ // Create wrapped cursor using Object.create() - inherits everything.
6208
+ // Important: .key and .primaryKey must be explicitly overridden with
6209
+ // closure-based getters to prevent native IDBCursorWithValue getters from
6210
+ // being reached through the prototype chain with a wrong `this`, which
6211
+ // throws "Illegal invocation" in Chrome 146+.
6208
6212
  const wrappedCursor = Object.create(cursor, {
6213
+ key: {
6214
+ get() { return cursor.key; },
6215
+ configurable: true,
6216
+ },
6217
+ primaryKey: {
6218
+ get() { return cursor.primaryKey; },
6219
+ configurable: true,
6220
+ },
6209
6221
  value: {
6210
6222
  value: cursor.value,
6211
6223
  enumerable: true,
@@ -6871,8 +6883,7 @@ function connectWebSocket(db) {
6871
6883
  throw new Error(`No database URL to connect WebSocket to`);
6872
6884
  }
6873
6885
  const readyForChangesMessage = db.messageConsumer.readyToServe.pipe(filter((isReady) => isReady), // When consumer is ready for new messages, produce such a message to inform server about it
6874
- switchMap(() => db.cloud.persistedSyncState.pipe(filter((syncState) => !!(syncState && syncState.serverRevision)), take(1))), // Wait reactively for syncState with serverRevision (avoids race with logout/re-sync)
6875
- switchMap((syncState) => __awaiter(this, void 0, void 0, function* () {
6886
+ switchMap(() => db.getPersistedSyncState()), filter((syncState) => !!(syncState && syncState.serverRevision)), switchMap((syncState) => __awaiter(this, void 0, void 0, function* () {
6876
6887
  return ({
6877
6888
  // Produce the message to trigger server to send us new messages to consume:
6878
6889
  type: 'ready',
@@ -8329,7 +8340,7 @@ function dexieCloud(dexie) {
8329
8340
  const downloading$ = createDownloadingState();
8330
8341
  dexie.cloud = {
8331
8342
  // @ts-ignore
8332
- version: "4.4.9",
8343
+ version: "4.4.11",
8333
8344
  options: Object.assign({}, DEFAULT_OPTIONS),
8334
8345
  schema: null,
8335
8346
  get currentUserId() {
@@ -8774,7 +8785,7 @@ function dexieCloud(dexie) {
8774
8785
  }
8775
8786
  }
8776
8787
  // @ts-ignore
8777
- dexieCloud.version = "4.4.9";
8788
+ dexieCloud.version = "4.4.11";
8778
8789
  Dexie.Cloud = dexieCloud;
8779
8790
 
8780
8791
  // In case the SW lives for a while, let it reuse already opened connections: