dexie-cloud-addon 4.0.1-beta.41 → 4.0.1-beta.42

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.41, Sat Jul 01 2023
11
+ * Version 4.0.1-beta.42, Sat Jul 01 2023
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -2750,7 +2750,10 @@ function listClientChanges(mutationTables, db, { since = {}, limit = Infinity }
2750
2750
  }));
2751
2751
  })));
2752
2752
  // Sort by time to get a true order of the operations (between tables)
2753
- const sorted = flatten(allMutsOnTables).sort((a, b) => a.mut.ts - b.mut.ts);
2753
+ const sorted = flatten(allMutsOnTables).sort((a, b) => a.mut.txid === b.mut.txid
2754
+ ? a.mut.opNo - b.mut.opNo // Within same transaction, sort by opNo
2755
+ : a.mut.ts - b.mut.ts // Different transactions - sort by timestamp when mutation resolved
2756
+ );
2754
2757
  const result = [];
2755
2758
  let currentEntry = null;
2756
2759
  let currentTxid = null;
@@ -6082,7 +6085,7 @@ function dexieCloud(dexie) {
6082
6085
  });
6083
6086
  const syncComplete = new Subject();
6084
6087
  dexie.cloud = {
6085
- version: '4.0.1-beta.41',
6088
+ version: '4.0.1-beta.42',
6086
6089
  options: Object.assign({}, DEFAULT_OPTIONS),
6087
6090
  schema: null,
6088
6091
  get currentUserId() {
@@ -6343,7 +6346,7 @@ function dexieCloud(dexie) {
6343
6346
  });
6344
6347
  }
6345
6348
  }
6346
- dexieCloud.version = '4.0.1-beta.41';
6349
+ dexieCloud.version = '4.0.1-beta.42';
6347
6350
  Dexie.Cloud = dexieCloud;
6348
6351
 
6349
6352
  export { dexieCloud as default, dexieCloud, getTiedObjectId, getTiedRealmId };