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
  *
@@ -6573,7 +6573,10 @@ function createMutationTrackingMiddleware({ currentUserObservable, db, }) {
6573
6573
  return keys.length > 0 || criteria
6574
6574
  ? mutsTable
6575
6575
  .mutate({ type: 'add', trans, values: [mut] }) // Log entry
6576
- .then(() => res) // Return original response
6576
+ .then(() => {
6577
+ trans.mutationsAdded = true; // Mark transaction as having added mutations to trigger eager sync
6578
+ return res; // Return original response
6579
+ })
6577
6580
  : res;
6578
6581
  });
6579
6582
  }
@@ -8093,7 +8096,7 @@ function dexieCloud(dexie) {
8093
8096
  const syncComplete = new Subject();
8094
8097
  dexie.cloud = {
8095
8098
  // @ts-ignore
8096
- version: "4.1.0-alpha.17",
8099
+ version: "4.1.0-alpha.19",
8097
8100
  options: Object.assign({}, DEFAULT_OPTIONS),
8098
8101
  schema: null,
8099
8102
  get currentUserId() {
@@ -8395,7 +8398,7 @@ function dexieCloud(dexie) {
8395
8398
  }
8396
8399
  }
8397
8400
  // @ts-ignore
8398
- dexieCloud.version = "4.1.0-alpha.17";
8401
+ dexieCloud.version = "4.1.0-alpha.19";
8399
8402
  Dexie.Cloud = dexieCloud;
8400
8403
 
8401
8404
  const ydocTriggers = {};
@@ -8420,8 +8423,8 @@ const createMiddleware = (db) => ({
8420
8423
  switch (req.type) {
8421
8424
  case 'add': {
8422
8425
  for (const yUpdateRow of req.values) {
8423
- if (typeof yUpdateRow.i !== 'number' || yUpdateRow.i < 1)
8424
- continue; // A syncer (i is string) or garbage collection state (i is 0) - ignore.
8426
+ if (yUpdateRow.k == undefined)
8427
+ continue; // A syncer or garbage collection state does not point to a key
8425
8428
  const primaryKey = yUpdateRow.k;
8426
8429
  const doc = DexieYProvider.getDocCache(db).find(parentTable, primaryKey, prop);
8427
8430
  if (doc) {
@@ -8451,9 +8454,8 @@ const createMiddleware = (db) => ({
8451
8454
  .then((updates) => {
8452
8455
  const keySet = new RangeSet();
8453
8456
  for (const { k } of updates) {
8454
- if (typeof k === 'number' && k > 0) {
8457
+ if (k != undefined)
8455
8458
  keySet.addKey(k);
8456
- }
8457
8459
  }
8458
8460
  for (const interval of keySet) {
8459
8461
  enqueueTrigger(db, tblName, interval.from, trigger);