dexie-cloud-addon 4.4.8 → 4.4.9

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.4.8, Tue Mar 31 2026
11
+ * Version 4.4.9, Tue Mar 31 2026
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -3768,7 +3768,7 @@ function _sync(db_1, options_1, schema_1) {
3768
3768
  return __awaiter(this, arguments, void 0, function* (db, options, schema, { isInitialSync, cancelToken, justCheckIfNeeded, purpose } = {
3769
3769
  isInitialSync: false,
3770
3770
  }) {
3771
- var _a, _b, _c;
3771
+ var _a, _b, _c, _d, _e;
3772
3772
  if (!justCheckIfNeeded) {
3773
3773
  console.debug('SYNC STARTED', { isInitialSync, purpose });
3774
3774
  }
@@ -3842,7 +3842,7 @@ function _sync(db_1, options_1, schema_1) {
3842
3842
  // Offload large blobs to blob storage before sync
3843
3843
  //
3844
3844
  let processedChangeSet = clientChangeSet;
3845
- const maxStringLength = (_c = (_b = db.cloud.options) === null || _b === void 0 ? void 0 : _b.maxStringLength) !== null && _c !== void 0 ? _c : 32768;
3845
+ const maxStringLength = (_e = (_c = (_b = db.cloud.options) === null || _b === void 0 ? void 0 : _b.largeStringThreshold) !== null && _c !== void 0 ? _c : (_d = db.cloud.options) === null || _d === void 0 ? void 0 : _d.maxStringLength) !== null && _e !== void 0 ? _e : 32768;
3846
3846
  const hasLargeBlobs = hasLargeBlobsInOperations(clientChangeSet, maxStringLength);
3847
3847
  if (hasLargeBlobs) {
3848
3848
  processedChangeSet = yield offloadBlobsInOperations(clientChangeSet, databaseUrl, () => loadCachedAccessToken(db), maxStringLength);
@@ -8329,7 +8329,7 @@ function dexieCloud(dexie) {
8329
8329
  const downloading$ = createDownloadingState();
8330
8330
  dexie.cloud = {
8331
8331
  // @ts-ignore
8332
- version: "4.4.8",
8332
+ version: "4.4.9",
8333
8333
  options: Object.assign({}, DEFAULT_OPTIONS),
8334
8334
  schema: null,
8335
8335
  get currentUserId() {
@@ -8357,18 +8357,27 @@ function dexieCloud(dexie) {
8357
8357
  invites: getInvitesObservable(dexie),
8358
8358
  roles: getGlobalRolesObservable(dexie),
8359
8359
  configure(options) {
8360
- // Validate maxStringLength Infinity disables offloading, otherwise must be
8361
- // a finite number between 100 and the server limit (32768).
8360
+ // Validate largeStringThreshold (preferred) or maxStringLength (deprecated)
8361
+ // Infinity disables offloading, otherwise must be a finite number between 100
8362
+ // and the server limit (32768).
8362
8363
  // Minimum 100 prevents accidental offloading of primary keys and short strings
8363
8364
  // that would break sync.
8364
8365
  const MIN_STRING_LENGTH = 100;
8365
8366
  const MAX_SERVER_STRING_LENGTH = 32768;
8366
- if (options.maxStringLength !== undefined &&
8367
- options.maxStringLength !== Infinity &&
8368
- (!Number.isFinite(options.maxStringLength) ||
8369
- options.maxStringLength < MIN_STRING_LENGTH ||
8370
- options.maxStringLength > MAX_SERVER_STRING_LENGTH)) {
8371
- throw new Error(`maxStringLength must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${options.maxStringLength}`);
8367
+ if (options.maxStringLength !== undefined) {
8368
+ console.warn('maxStringLength is deprecated, use largeStringThreshold instead');
8369
+ // If largeStringThreshold is not explicitly set, migrate to new name
8370
+ if (options.largeStringThreshold === undefined) {
8371
+ options = Object.assign(Object.assign({}, options), { largeStringThreshold: options.maxStringLength });
8372
+ }
8373
+ }
8374
+ const thresholdValue = options.largeStringThreshold;
8375
+ if (thresholdValue !== undefined &&
8376
+ thresholdValue !== Infinity &&
8377
+ (!Number.isFinite(thresholdValue) ||
8378
+ thresholdValue < MIN_STRING_LENGTH ||
8379
+ thresholdValue > MAX_SERVER_STRING_LENGTH)) {
8380
+ throw new Error(`largeStringThreshold must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${thresholdValue}`);
8372
8381
  }
8373
8382
  options = dexie.cloud.options = Object.assign(Object.assign({}, dexie.cloud.options), options);
8374
8383
  configuredProgramatically = true;
@@ -8765,7 +8774,7 @@ function dexieCloud(dexie) {
8765
8774
  }
8766
8775
  }
8767
8776
  // @ts-ignore
8768
- dexieCloud.version = "4.4.8";
8777
+ dexieCloud.version = "4.4.9";
8769
8778
  Dexie.Cloud = dexieCloud;
8770
8779
 
8771
8780
  // In case the SW lives for a while, let it reuse already opened connections: