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

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.15, Fri Oct 18 2024
11
+ * Version 4.1.0-alpha.17, Fri Oct 18 2024
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -8096,7 +8096,7 @@
8096
8096
  const syncComplete = new rxjs.Subject();
8097
8097
  dexie.cloud = {
8098
8098
  // @ts-ignore
8099
- version: "4.1.0-alpha.15",
8099
+ version: "4.1.0-alpha.17",
8100
8100
  options: Object.assign({}, DEFAULT_OPTIONS),
8101
8101
  schema: null,
8102
8102
  get currentUserId() {
@@ -8398,7 +8398,7 @@
8398
8398
  }
8399
8399
  }
8400
8400
  // @ts-ignore
8401
- dexieCloud.version = "4.1.0-alpha.15";
8401
+ dexieCloud.version = "4.1.0-alpha.17";
8402
8402
  Dexie.Cloud = dexieCloud;
8403
8403
 
8404
8404
  const ydocTriggers = {};
@@ -8423,6 +8423,8 @@
8423
8423
  switch (req.type) {
8424
8424
  case 'add': {
8425
8425
  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.
8426
8428
  const primaryKey = yUpdateRow.k;
8427
8429
  const doc = Dexie.DexieYProvider.getDocCache(db).find(parentTable, primaryKey, prop);
8428
8430
  if (doc) {
@@ -8452,10 +8454,12 @@
8452
8454
  .then((updates) => {
8453
8455
  const keySet = new Dexie.RangeSet();
8454
8456
  for (const { k } of updates) {
8455
- keySet.addKey(k);
8457
+ if (typeof k === 'number' && k > 0) {
8458
+ keySet.addKey(k);
8459
+ }
8456
8460
  }
8457
- for (const key of keySet) {
8458
- enqueueTrigger(db, tblName, key, trigger);
8461
+ for (const interval of keySet) {
8462
+ enqueueTrigger(db, tblName, interval.from, trigger);
8459
8463
  }
8460
8464
  });
8461
8465
  }
@@ -8500,9 +8504,9 @@
8500
8504
  function enqueueTrigger(db, updatesTable, parentId, trigger) {
8501
8505
  scheduledTriggers.push({
8502
8506
  db,
8507
+ updatesTable,
8503
8508
  parentId,
8504
8509
  trigger,
8505
- updatesTable
8506
8510
  });
8507
8511
  }
8508
8512
  function onTransactionCommitted() {