dexie-cloud-addon 4.0.1-beta.45 → 4.0.1-beta.46

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.0.1-beta.44, Wed Jul 05 2023
11
+ * Version 4.0.1-beta.46, Sat Aug 05 2023
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -3413,9 +3413,19 @@
3413
3413
  const mutClone = changeClone.muts[mutIndex];
3414
3414
  const rewrittenKey = JSON.stringify(key);
3415
3415
  mutClone.keys[keyIndex] = rewrittenKey;
3416
- if (rewriteValues) {
3417
- Dexie__default["default"].setByKeyPath(mutClone.values[keyIndex], primaryKey.keyPath, rewrittenKey);
3418
- }
3416
+ /* Bug (#1777)
3417
+ We should not rewrite values. It will fail because the key is array and the value is string.
3418
+ Only the keys should be rewritten and it's already done on the server.
3419
+ We should take another round of revieweing how key transformations are being done between
3420
+ client and server and let the server do the key transformations entirely instead now that
3421
+ we have the primary key schema on the server making it possible to do so.
3422
+ if (rewriteValues) {
3423
+ Dexie.setByKeyPath(
3424
+ (mutClone as DBInsertOperation).values[keyIndex],
3425
+ primaryKey.keyPath!,
3426
+ rewrittenKey
3427
+ );
3428
+ }*/
3419
3429
  }
3420
3430
  else if (key[0] === '#') {
3421
3431
  // Private ID - translate!
@@ -3722,7 +3732,7 @@
3722
3732
  });
3723
3733
  db.syncStateChangedEvent.next({
3724
3734
  phase: isOnline ? 'error' : 'offline',
3725
- error,
3735
+ error: new Error('' + (error === null || error === void 0 ? void 0 : error.message) || error),
3726
3736
  });
3727
3737
  return Promise.reject(error);
3728
3738
  }));
@@ -6107,7 +6117,7 @@
6107
6117
  });
6108
6118
  const syncComplete = new rxjs.Subject();
6109
6119
  dexie.cloud = {
6110
- version: '4.0.1-beta.44',
6120
+ version: '4.0.1-beta.46',
6111
6121
  options: Object.assign({}, DEFAULT_OPTIONS),
6112
6122
  schema: null,
6113
6123
  get currentUserId() {
@@ -6368,7 +6378,7 @@
6368
6378
  });
6369
6379
  }
6370
6380
  }
6371
- dexieCloud.version = '4.0.1-beta.44';
6381
+ dexieCloud.version = '4.0.1-beta.46';
6372
6382
  Dexie__default["default"].Cloud = dexieCloud;
6373
6383
 
6374
6384
  exports["default"] = dexieCloud;