dexie-cloud-addon 4.1.0-alpha.17 → 4.1.0-alpha.19

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.1.0-alpha.17, Fri Oct 18 2024
11
+ * Version 4.1.0-alpha.19, Fri Oct 18 2024
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -6576,7 +6576,10 @@
6576
6576
  return keys.length > 0 || criteria
6577
6577
  ? mutsTable
6578
6578
  .mutate({ type: 'add', trans, values: [mut] }) // Log entry
6579
- .then(() => res) // Return original response
6579
+ .then(() => {
6580
+ trans.mutationsAdded = true; // Mark transaction as having added mutations to trigger eager sync
6581
+ return res; // Return original response
6582
+ })
6580
6583
  : res;
6581
6584
  });
6582
6585
  }
@@ -8096,7 +8099,7 @@
8096
8099
  const syncComplete = new rxjs.Subject();
8097
8100
  dexie.cloud = {
8098
8101
  // @ts-ignore
8099
- version: "4.1.0-alpha.17",
8102
+ version: "4.1.0-alpha.19",
8100
8103
  options: Object.assign({}, DEFAULT_OPTIONS),
8101
8104
  schema: null,
8102
8105
  get currentUserId() {
@@ -8398,7 +8401,7 @@
8398
8401
  }
8399
8402
  }
8400
8403
  // @ts-ignore
8401
- dexieCloud.version = "4.1.0-alpha.17";
8404
+ dexieCloud.version = "4.1.0-alpha.19";
8402
8405
  Dexie.Cloud = dexieCloud;
8403
8406
 
8404
8407
  const ydocTriggers = {};
@@ -8423,8 +8426,8 @@
8423
8426
  switch (req.type) {
8424
8427
  case 'add': {
8425
8428
  for (const yUpdateRow of req.values) {
8426
- if (typeof yUpdateRow.i !== 'number' || yUpdateRow.i < 1)
8427
- continue; // A syncer (i is string) or garbage collection state (i is 0) - ignore.
8429
+ if (yUpdateRow.k == undefined)
8430
+ continue; // A syncer or garbage collection state does not point to a key
8428
8431
  const primaryKey = yUpdateRow.k;
8429
8432
  const doc = Dexie.DexieYProvider.getDocCache(db).find(parentTable, primaryKey, prop);
8430
8433
  if (doc) {
@@ -8454,9 +8457,8 @@
8454
8457
  .then((updates) => {
8455
8458
  const keySet = new Dexie.RangeSet();
8456
8459
  for (const { k } of updates) {
8457
- if (typeof k === 'number' && k > 0) {
8460
+ if (k != undefined)
8458
8461
  keySet.addKey(k);
8459
- }
8460
8462
  }
8461
8463
  for (const interval of keySet) {
8462
8464
  enqueueTrigger(db, tblName, interval.from, trigger);