dexie-cloud-addon 4.0.8 → 4.0.12

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.
Files changed (47) hide show
  1. package/dist/modern/define-ydoc-trigger.d.ts +2 -0
  2. package/dist/modern/dexie-cloud-addon.js +21 -14
  3. package/dist/modern/dexie-cloud-addon.js.map +1 -1
  4. package/dist/modern/dexie-cloud-addon.min.js +1 -1
  5. package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
  6. package/dist/modern/service-worker.js +21 -14
  7. package/dist/modern/service-worker.js.map +1 -1
  8. package/dist/modern/service-worker.min.js +1 -1
  9. package/dist/modern/service-worker.min.js.map +1 -1
  10. package/dist/modern/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +1 -0
  11. package/dist/modern/yjs/Y.d.ts +3 -0
  12. package/dist/modern/yjs/YDexieCloudSyncState.d.ts +3 -0
  13. package/dist/modern/yjs/YTable.d.ts +2 -0
  14. package/dist/modern/yjs/applyYMessages.d.ts +9 -0
  15. package/dist/modern/yjs/awareness.d.ts +4 -0
  16. package/dist/modern/yjs/createYClientUpdateObservable.d.ts +4 -0
  17. package/dist/modern/yjs/createYHandler.d.ts +5 -0
  18. package/dist/modern/yjs/downloadYDocsFromServer.d.ts +3 -0
  19. package/dist/modern/yjs/getUpdatesTable.d.ts +3 -0
  20. package/dist/modern/yjs/listUpdatesSince.d.ts +2 -0
  21. package/dist/modern/yjs/listYClientMessagesAndStateVector.d.ts +26 -0
  22. package/dist/modern/yjs/reopenDocSignal.d.ts +10 -0
  23. package/dist/modern/yjs/updateYSyncStates.d.ts +6 -0
  24. package/dist/umd/define-ydoc-trigger.d.ts +2 -0
  25. package/dist/umd/dexie-cloud-addon.js +21 -14
  26. package/dist/umd/dexie-cloud-addon.js.map +1 -1
  27. package/dist/umd/dexie-cloud-addon.min.js +1 -1
  28. package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
  29. package/dist/umd/service-worker.js +21 -14
  30. package/dist/umd/service-worker.js.map +1 -1
  31. package/dist/umd/service-worker.min.js +1 -1
  32. package/dist/umd/service-worker.min.js.map +1 -1
  33. package/dist/umd/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +1 -0
  34. package/dist/umd/yjs/Y.d.ts +3 -0
  35. package/dist/umd/yjs/YDexieCloudSyncState.d.ts +3 -0
  36. package/dist/umd/yjs/YTable.d.ts +2 -0
  37. package/dist/umd/yjs/applyYMessages.d.ts +9 -0
  38. package/dist/umd/yjs/awareness.d.ts +4 -0
  39. package/dist/umd/yjs/createYClientUpdateObservable.d.ts +4 -0
  40. package/dist/umd/yjs/createYHandler.d.ts +5 -0
  41. package/dist/umd/yjs/downloadYDocsFromServer.d.ts +3 -0
  42. package/dist/umd/yjs/getUpdatesTable.d.ts +3 -0
  43. package/dist/umd/yjs/listUpdatesSince.d.ts +2 -0
  44. package/dist/umd/yjs/listYClientMessagesAndStateVector.d.ts +26 -0
  45. package/dist/umd/yjs/reopenDocSignal.d.ts +10 -0
  46. package/dist/umd/yjs/updateYSyncStates.d.ts +6 -0
  47. package/package.json +2 -2
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.0.8, Tue Jun 04 2024
11
+ * Version 4.0.12, Mon Jun 09 2025
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -2824,7 +2824,7 @@ var numberDef = {
2824
2824
  },
2825
2825
  };
2826
2826
 
2827
- const bigIntDef = {
2827
+ const bigIntDef$1 = {
2828
2828
  bigint: {
2829
2829
  replace: (realVal) => {
2830
2830
  return { $t: "bigint", v: "" + realVal };
@@ -3067,7 +3067,7 @@ var BlobDef = {
3067
3067
 
3068
3068
  const builtin = {
3069
3069
  ...numberDef,
3070
- ...bigIntDef,
3070
+ ...bigIntDef$1,
3071
3071
  ...DateDef,
3072
3072
  ...SetDef,
3073
3073
  ...MapDef,
@@ -3177,7 +3177,7 @@ class FakeBigInt {
3177
3177
  this.v = value;
3178
3178
  }
3179
3179
  }
3180
- const defs = Object.assign(Object.assign(Object.assign({}, undefinedDef), (hasBigIntSupport
3180
+ const bigIntDef = hasBigIntSupport
3181
3181
  ? {}
3182
3182
  : {
3183
3183
  bigint: {
@@ -3185,17 +3185,19 @@ const defs = Object.assign(Object.assign(Object.assign({}, undefinedDef), (hasBi
3185
3185
  replace: (fakeBigInt) => {
3186
3186
  return Object.assign({ $t: 'bigint' }, fakeBigInt);
3187
3187
  },
3188
- revive: ({ v, }) => new FakeBigInt(v)
3189
- }
3190
- })), { PropModification: {
3188
+ revive: ({ v }) => new FakeBigInt(v),
3189
+ },
3190
+ };
3191
+ const defs = Object.assign(Object.assign(Object.assign({}, undefinedDef), bigIntDef), { PropModification: {
3191
3192
  test: (val) => val instanceof PropModification,
3192
3193
  replace: (propModification) => {
3193
- return Object.assign({ $t: 'PropModification' }, propModification);
3194
+ return Object.assign({ $t: 'PropModification' }, propModification['@@propmod']);
3194
3195
  },
3195
3196
  revive: (_a) => {
3196
- var propModification = __rest(_a, ["$t"]);
3197
- return new PropModification(propModification);
3198
- }
3197
+ var propModSpec = __rest(_a, ["$t"]) // keep the rest
3198
+ ;
3199
+ return new PropModification(propModSpec);
3200
+ },
3199
3201
  } });
3200
3202
  const TSON = TypesonSimplified(builtin, defs);
3201
3203
  const BISON = Bison(defs);
@@ -3444,6 +3446,9 @@ function updateBaseRevs(db, schema, latestRevisions, serverRev) {
3444
3446
  serverRev,
3445
3447
  };
3446
3448
  }));
3449
+ // Clean up baseRevs for tables that do not exist anymore or are no longer marked for sync
3450
+ // Resolve #2168 by also cleaning up baseRevs for tables that are not marked for sync
3451
+ yield db.$baseRevs.where('tableName').noneOf(Object.keys(schema).filter((table) => schema[table].markedForSync)).delete();
3447
3452
  });
3448
3453
  }
3449
3454
 
@@ -3649,7 +3654,9 @@ function _sync(db, options, schema, { isInitialSync, cancelToken, justCheckIfNee
3649
3654
  //
3650
3655
  const [clientChangeSet, syncState, baseRevs] = yield db.transaction('r', db.tables, () => __awaiter(this, void 0, void 0, function* () {
3651
3656
  const syncState = yield db.getPersistedSyncState();
3652
- const baseRevs = yield db.$baseRevs.toArray();
3657
+ let baseRevs = yield db.$baseRevs.toArray();
3658
+ // Resolve #2168
3659
+ baseRevs = baseRevs.filter(br => tablesToSync.some(tbl => tbl.name === br.tableName));
3653
3660
  let clientChanges = yield listClientChanges(mutationTables);
3654
3661
  throwIfCancelled(cancelToken);
3655
3662
  if (doSyncify) {
@@ -6303,7 +6310,7 @@ function dexieCloud(dexie) {
6303
6310
  const syncComplete = new Subject();
6304
6311
  dexie.cloud = {
6305
6312
  // @ts-ignore
6306
- version: "4.0.8",
6313
+ version: "4.0.12",
6307
6314
  options: Object.assign({}, DEFAULT_OPTIONS),
6308
6315
  schema: null,
6309
6316
  get currentUserId() {
@@ -6598,7 +6605,7 @@ function dexieCloud(dexie) {
6598
6605
  }
6599
6606
  }
6600
6607
  // @ts-ignore
6601
- dexieCloud.version = "4.0.8";
6608
+ dexieCloud.version = "4.0.12";
6602
6609
  Dexie.Cloud = dexieCloud;
6603
6610
 
6604
6611
  // In case the SW lives for a while, let it reuse already opened connections: