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

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.
@@ -2999,6 +2999,7 @@ function createMutationTrackingMiddleware({ currentUserObservable, db }) {
2999
2999
  if (mode === 'readwrite') {
3000
3000
  // Give each transaction a globally unique id.
3001
3001
  tx.txid = randomString$1(16);
3002
+ tx.opCount = 0;
3002
3003
  // Introduce the concept of current user that lasts through the entire transaction.
3003
3004
  // This is important because the tracked mutations must be connected to the user.
3004
3005
  tx.currentUser = currentUserObservable.value;
@@ -3105,6 +3106,7 @@ function createMutationTrackingMiddleware({ currentUserObservable, db }) {
3105
3106
  trans.mutationsAdded = true;
3106
3107
  const { txid, currentUser: { userId } } = trans;
3107
3108
  const { type } = req;
3109
+ const opNo = ++trans.opCount;
3108
3110
  return table.mutate(req).then((res) => {
3109
3111
  const { numFailures: hasFailures, failures } = res;
3110
3112
  let keys = type === 'delete' ? req.keys : res.results;
@@ -3119,6 +3121,7 @@ function createMutationTrackingMiddleware({ currentUserObservable, db }) {
3119
3121
  ? {
3120
3122
  type: 'delete',
3121
3123
  ts,
3124
+ opNo,
3122
3125
  keys,
3123
3126
  criteria: req.criteria,
3124
3127
  txid,
@@ -4434,7 +4437,7 @@ function dexieCloud(dexie) {
4434
4437
  });
4435
4438
  const syncComplete = new Subject();
4436
4439
  dexie.cloud = {
4437
- version: '4.0.1-beta.40',
4440
+ version: '4.0.1-beta.41',
4438
4441
  options: Object.assign({}, DEFAULT_OPTIONS),
4439
4442
  schema: null,
4440
4443
  get currentUserId() {
@@ -4695,7 +4698,7 @@ function dexieCloud(dexie) {
4695
4698
  });
4696
4699
  }
4697
4700
  }
4698
- dexieCloud.version = '4.0.1-beta.40';
4701
+ dexieCloud.version = '4.0.1-beta.41';
4699
4702
  Dexie.Cloud = dexieCloud;
4700
4703
 
4701
4704
  // In case the SW lives for a while, let it reuse already opened connections: