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.
@@ -1545,9 +1545,19 @@
1545
1545
  const mutClone = changeClone.muts[mutIndex];
1546
1546
  const rewrittenKey = JSON.stringify(key);
1547
1547
  mutClone.keys[keyIndex] = rewrittenKey;
1548
- if (rewriteValues) {
1549
- Dexie__default["default"].setByKeyPath(mutClone.values[keyIndex], primaryKey.keyPath, rewrittenKey);
1550
- }
1548
+ /* Bug (#1777)
1549
+ We should not rewrite values. It will fail because the key is array and the value is string.
1550
+ Only the keys should be rewritten and it's already done on the server.
1551
+ We should take another round of revieweing how key transformations are being done between
1552
+ client and server and let the server do the key transformations entirely instead now that
1553
+ we have the primary key schema on the server making it possible to do so.
1554
+ if (rewriteValues) {
1555
+ Dexie.setByKeyPath(
1556
+ (mutClone as DBInsertOperation).values[keyIndex],
1557
+ primaryKey.keyPath!,
1558
+ rewrittenKey
1559
+ );
1560
+ }*/
1551
1561
  }
1552
1562
  else if (key[0] === '#') {
1553
1563
  // Private ID - translate!
@@ -1854,7 +1864,7 @@
1854
1864
  });
1855
1865
  db.syncStateChangedEvent.next({
1856
1866
  phase: isOnline ? 'error' : 'offline',
1857
- error,
1867
+ error: new Error('' + (error === null || error === void 0 ? void 0 : error.message) || error),
1858
1868
  });
1859
1869
  return Promise.reject(error);
1860
1870
  }));
@@ -4461,7 +4471,7 @@
4461
4471
  });
4462
4472
  const syncComplete = new rxjs.Subject();
4463
4473
  dexie.cloud = {
4464
- version: '4.0.1-beta.44',
4474
+ version: '4.0.1-beta.46',
4465
4475
  options: Object.assign({}, DEFAULT_OPTIONS),
4466
4476
  schema: null,
4467
4477
  get currentUserId() {
@@ -4722,7 +4732,7 @@
4722
4732
  });
4723
4733
  }
4724
4734
  }
4725
- dexieCloud.version = '4.0.1-beta.44';
4735
+ dexieCloud.version = '4.0.1-beta.46';
4726
4736
  Dexie__default["default"].Cloud = dexieCloud;
4727
4737
 
4728
4738
  // In case the SW lives for a while, let it reuse already opened connections: