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
  *
@@ -14736,7 +14736,7 @@
14736
14736
  return __awaiter(this, arguments, void 0, function* (db, options, schema, { isInitialSync, cancelToken, justCheckIfNeeded, purpose } = {
14737
14737
  isInitialSync: false,
14738
14738
  }) {
14739
- var _a, _b, _c;
14739
+ var _a, _b, _c, _d, _e;
14740
14740
  if (!justCheckIfNeeded) {
14741
14741
  console.debug('SYNC STARTED', { isInitialSync, purpose });
14742
14742
  }
@@ -14810,7 +14810,7 @@
14810
14810
  // Offload large blobs to blob storage before sync
14811
14811
  //
14812
14812
  let processedChangeSet = clientChangeSet;
14813
- const maxStringLength = (_c = (_b = db.cloud.options) === null || _b === void 0 ? void 0 : _b.maxStringLength) !== null && _c !== void 0 ? _c : 32768;
14813
+ 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;
14814
14814
  const hasLargeBlobs = hasLargeBlobsInOperations(clientChangeSet, maxStringLength);
14815
14815
  if (hasLargeBlobs) {
14816
14816
  processedChangeSet = yield offloadBlobsInOperations(clientChangeSet, databaseUrl, () => loadCachedAccessToken(db), maxStringLength);
@@ -19559,7 +19559,7 @@
19559
19559
  const downloading$ = createDownloadingState();
19560
19560
  dexie.cloud = {
19561
19561
  // @ts-ignore
19562
- version: "4.4.8",
19562
+ version: "4.4.9",
19563
19563
  options: Object.assign({}, DEFAULT_OPTIONS),
19564
19564
  schema: null,
19565
19565
  get currentUserId() {
@@ -19587,18 +19587,27 @@
19587
19587
  invites: getInvitesObservable(dexie),
19588
19588
  roles: getGlobalRolesObservable(dexie),
19589
19589
  configure(options) {
19590
- // Validate maxStringLength Infinity disables offloading, otherwise must be
19591
- // a finite number between 100 and the server limit (32768).
19590
+ // Validate largeStringThreshold (preferred) or maxStringLength (deprecated)
19591
+ // Infinity disables offloading, otherwise must be a finite number between 100
19592
+ // and the server limit (32768).
19592
19593
  // Minimum 100 prevents accidental offloading of primary keys and short strings
19593
19594
  // that would break sync.
19594
19595
  const MIN_STRING_LENGTH = 100;
19595
19596
  const MAX_SERVER_STRING_LENGTH = 32768;
19596
- if (options.maxStringLength !== undefined &&
19597
- options.maxStringLength !== Infinity &&
19598
- (!Number.isFinite(options.maxStringLength) ||
19599
- options.maxStringLength < MIN_STRING_LENGTH ||
19600
- options.maxStringLength > MAX_SERVER_STRING_LENGTH)) {
19601
- throw new Error(`maxStringLength must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${options.maxStringLength}`);
19597
+ if (options.maxStringLength !== undefined) {
19598
+ console.warn('maxStringLength is deprecated, use largeStringThreshold instead');
19599
+ // If largeStringThreshold is not explicitly set, migrate to new name
19600
+ if (options.largeStringThreshold === undefined) {
19601
+ options = Object.assign(Object.assign({}, options), { largeStringThreshold: options.maxStringLength });
19602
+ }
19603
+ }
19604
+ const thresholdValue = options.largeStringThreshold;
19605
+ if (thresholdValue !== undefined &&
19606
+ thresholdValue !== Infinity &&
19607
+ (!Number.isFinite(thresholdValue) ||
19608
+ thresholdValue < MIN_STRING_LENGTH ||
19609
+ thresholdValue > MAX_SERVER_STRING_LENGTH)) {
19610
+ throw new Error(`largeStringThreshold must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${thresholdValue}`);
19602
19611
  }
19603
19612
  options = dexie.cloud.options = Object.assign(Object.assign({}, dexie.cloud.options), options);
19604
19613
  configuredProgramatically = true;
@@ -19995,7 +20004,7 @@
19995
20004
  }
19996
20005
  }
19997
20006
  // @ts-ignore
19998
- dexieCloud.version = "4.4.8";
20007
+ dexieCloud.version = "4.4.9";
19999
20008
  Dexie.Cloud = dexieCloud;
20000
20009
 
20001
20010
  // In case the SW lives for a while, let it reuse already opened connections: