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
  *
@@ -15606,7 +15606,7 @@
15606
15606
  return __awaiter(this, arguments, void 0, function* (db, options, schema, { isInitialSync, cancelToken, justCheckIfNeeded, purpose } = {
15607
15607
  isInitialSync: false,
15608
15608
  }) {
15609
- var _a, _b, _c;
15609
+ var _a, _b, _c, _d, _e;
15610
15610
  if (!justCheckIfNeeded) {
15611
15611
  console.debug('SYNC STARTED', { isInitialSync, purpose });
15612
15612
  }
@@ -15680,7 +15680,7 @@
15680
15680
  // Offload large blobs to blob storage before sync
15681
15681
  //
15682
15682
  let processedChangeSet = clientChangeSet;
15683
- const maxStringLength = (_c = (_b = db.cloud.options) === null || _b === void 0 ? void 0 : _b.maxStringLength) !== null && _c !== void 0 ? _c : 32768;
15683
+ 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;
15684
15684
  const hasLargeBlobs = hasLargeBlobsInOperations(clientChangeSet, maxStringLength);
15685
15685
  if (hasLargeBlobs) {
15686
15686
  processedChangeSet = yield offloadBlobsInOperations(clientChangeSet, databaseUrl, () => loadCachedAccessToken(db), maxStringLength);
@@ -19730,7 +19730,7 @@
19730
19730
  const downloading$ = createDownloadingState();
19731
19731
  dexie.cloud = {
19732
19732
  // @ts-ignore
19733
- version: "4.4.8",
19733
+ version: "4.4.9",
19734
19734
  options: Object.assign({}, DEFAULT_OPTIONS),
19735
19735
  schema: null,
19736
19736
  get currentUserId() {
@@ -19758,18 +19758,27 @@
19758
19758
  invites: getInvitesObservable(dexie),
19759
19759
  roles: getGlobalRolesObservable(dexie),
19760
19760
  configure(options) {
19761
- // Validate maxStringLength Infinity disables offloading, otherwise must be
19762
- // a finite number between 100 and the server limit (32768).
19761
+ // Validate largeStringThreshold (preferred) or maxStringLength (deprecated)
19762
+ // Infinity disables offloading, otherwise must be a finite number between 100
19763
+ // and the server limit (32768).
19763
19764
  // Minimum 100 prevents accidental offloading of primary keys and short strings
19764
19765
  // that would break sync.
19765
19766
  const MIN_STRING_LENGTH = 100;
19766
19767
  const MAX_SERVER_STRING_LENGTH = 32768;
19767
- if (options.maxStringLength !== undefined &&
19768
- options.maxStringLength !== Infinity &&
19769
- (!Number.isFinite(options.maxStringLength) ||
19770
- options.maxStringLength < MIN_STRING_LENGTH ||
19771
- options.maxStringLength > MAX_SERVER_STRING_LENGTH)) {
19772
- throw new Error(`maxStringLength must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${options.maxStringLength}`);
19768
+ if (options.maxStringLength !== undefined) {
19769
+ console.warn('maxStringLength is deprecated, use largeStringThreshold instead');
19770
+ // If largeStringThreshold is not explicitly set, migrate to new name
19771
+ if (options.largeStringThreshold === undefined) {
19772
+ options = Object.assign(Object.assign({}, options), { largeStringThreshold: options.maxStringLength });
19773
+ }
19774
+ }
19775
+ const thresholdValue = options.largeStringThreshold;
19776
+ if (thresholdValue !== undefined &&
19777
+ thresholdValue !== Infinity &&
19778
+ (!Number.isFinite(thresholdValue) ||
19779
+ thresholdValue < MIN_STRING_LENGTH ||
19780
+ thresholdValue > MAX_SERVER_STRING_LENGTH)) {
19781
+ throw new Error(`largeStringThreshold must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${thresholdValue}`);
19773
19782
  }
19774
19783
  options = dexie.cloud.options = Object.assign(Object.assign({}, dexie.cloud.options), options);
19775
19784
  configuredProgramatically = true;
@@ -20166,7 +20175,7 @@
20166
20175
  }
20167
20176
  }
20168
20177
  // @ts-ignore
20169
- dexieCloud.version = "4.4.8";
20178
+ dexieCloud.version = "4.4.9";
20170
20179
  Dexie.Cloud = dexieCloud;
20171
20180
 
20172
20181
  exports.default = dexieCloud;