dexie-cloud-addon 4.1.0-beta.38 → 4.1.0-beta.39

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-beta.38, Fri Dec 06 2024
11
+ * Version 4.1.0-beta.39, Mon Jan 20 2025
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -3906,7 +3906,7 @@ var numberDef = {
3906
3906
  },
3907
3907
  };
3908
3908
 
3909
- const bigIntDef = {
3909
+ const bigIntDef$1 = {
3910
3910
  bigint: {
3911
3911
  replace: (realVal) => {
3912
3912
  return { $t: "bigint", v: "" + realVal };
@@ -4149,7 +4149,7 @@ var BlobDef = {
4149
4149
 
4150
4150
  const builtin = {
4151
4151
  ...numberDef,
4152
- ...bigIntDef,
4152
+ ...bigIntDef$1,
4153
4153
  ...DateDef,
4154
4154
  ...SetDef,
4155
4155
  ...MapDef,
@@ -4259,7 +4259,7 @@ class FakeBigInt {
4259
4259
  this.v = value;
4260
4260
  }
4261
4261
  }
4262
- const defs = Object.assign(Object.assign(Object.assign({}, undefinedDef), (hasBigIntSupport
4262
+ const bigIntDef = hasBigIntSupport
4263
4263
  ? {}
4264
4264
  : {
4265
4265
  bigint: {
@@ -4267,17 +4267,19 @@ const defs = Object.assign(Object.assign(Object.assign({}, undefinedDef), (hasBi
4267
4267
  replace: (fakeBigInt) => {
4268
4268
  return Object.assign({ $t: 'bigint' }, fakeBigInt);
4269
4269
  },
4270
- revive: ({ v, }) => new FakeBigInt(v)
4271
- }
4272
- })), { PropModification: {
4270
+ revive: ({ v }) => new FakeBigInt(v),
4271
+ },
4272
+ };
4273
+ const defs = Object.assign(Object.assign(Object.assign({}, undefinedDef), bigIntDef), { PropModification: {
4273
4274
  test: (val) => val instanceof PropModification,
4274
4275
  replace: (propModification) => {
4275
- return Object.assign({ $t: 'PropModification' }, propModification);
4276
+ return Object.assign({ $t: 'PropModification' }, propModification['@@propmod']);
4276
4277
  },
4277
4278
  revive: (_a) => {
4278
- var propModification = __rest(_a, ["$t"]);
4279
- return new PropModification(propModification);
4280
- }
4279
+ var propModSpec = __rest(_a, ["$t"]) // keep the rest
4280
+ ;
4281
+ return new PropModification(propModSpec);
4282
+ },
4281
4283
  } });
4282
4284
  const TSON = TypesonSimplified(builtin, defs);
4283
4285
  const BISON = Bison(defs);
@@ -4435,11 +4437,12 @@ function syncWithServer(changes, y, syncState, baseRevs, db, databaseUrl, schema
4435
4437
  db.syncStateChangedEvent.next({
4436
4438
  phase: 'pushing',
4437
4439
  });
4440
+ const body = TSON.stringify(syncRequest);
4438
4441
  const res = yield fetch(`${databaseUrl}/sync`, {
4439
4442
  method: 'post',
4440
4443
  headers,
4441
4444
  credentials: 'include', // For Arr Affinity cookie only, for better Rate-Limit counting only.
4442
- body: TSON.stringify(syncRequest),
4445
+ body,
4443
4446
  });
4444
4447
  //const contentLength = Number(res.headers.get('content-length'));
4445
4448
  db.syncStateChangedEvent.next({
@@ -5274,7 +5277,12 @@ function _sync(db_1, options_1, schema_1) {
5274
5277
  const usingYProps = Object.values(schema).some(tbl => { var _a; return (_a = tbl.yProps) === null || _a === void 0 ? void 0 : _a.length; });
5275
5278
  const serverSupportsYprops = !!res.yMessages;
5276
5279
  if (usingYProps && serverSupportsYprops) {
5277
- yield downloadYDocsFromServer(db, databaseUrl, newSyncState);
5280
+ try {
5281
+ yield downloadYDocsFromServer(db, databaseUrl, newSyncState);
5282
+ }
5283
+ catch (error) {
5284
+ console.error('Failed to download Yjs documents from server', error);
5285
+ }
5278
5286
  }
5279
5287
  console.debug('SYNC DONE', { isInitialSync });
5280
5288
  db.syncCompleteEvent.next();
@@ -8150,7 +8158,7 @@ function dexieCloud(dexie) {
8150
8158
  const syncComplete = new Subject();
8151
8159
  dexie.cloud = {
8152
8160
  // @ts-ignore
8153
- version: "4.1.0-beta.38",
8161
+ version: "4.1.0-beta.39",
8154
8162
  options: Object.assign({}, DEFAULT_OPTIONS),
8155
8163
  schema: null,
8156
8164
  get currentUserId() {
@@ -8468,7 +8476,7 @@ function dexieCloud(dexie) {
8468
8476
  }
8469
8477
  }
8470
8478
  // @ts-ignore
8471
- dexieCloud.version = "4.1.0-beta.38";
8479
+ dexieCloud.version = "4.1.0-beta.39";
8472
8480
  Dexie.Cloud = dexieCloud;
8473
8481
 
8474
8482
  // In case the SW lives for a while, let it reuse already opened connections: