dexie-cloud-addon 4.4.8 → 4.4.10

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.10, Sat Apr 04 2026
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -13623,7 +13623,7 @@
13623
13623
  *
13624
13624
  * ==========================================================================
13625
13625
  *
13626
- * Version 4.4.0, Tue Mar 31 2026
13626
+ * Version 4.4.0, Sat Apr 04 2026
13627
13627
  *
13628
13628
  * https://dexie.org
13629
13629
  *
@@ -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);
@@ -17172,8 +17172,20 @@
17172
17172
  * each onNext callback, ensuring cursor.value is always available.
17173
17173
  */
17174
17174
  function createBlobResolvingCursor(cursor, table, blobSavingQueue, db) {
17175
- // Create wrapped cursor using Object.create() - inherits everything
17175
+ // Create wrapped cursor using Object.create() - inherits everything.
17176
+ // Important: .key and .primaryKey must be explicitly overridden with
17177
+ // closure-based getters to prevent native IDBCursorWithValue getters from
17178
+ // being reached through the prototype chain with a wrong `this`, which
17179
+ // throws "Illegal invocation" in Chrome 146+.
17176
17180
  const wrappedCursor = Object.create(cursor, {
17181
+ key: {
17182
+ get() { return cursor.key; },
17183
+ configurable: true,
17184
+ },
17185
+ primaryKey: {
17186
+ get() { return cursor.primaryKey; },
17187
+ configurable: true,
17188
+ },
17177
17189
  value: {
17178
17190
  value: cursor.value,
17179
17191
  enumerable: true,
@@ -19559,7 +19571,7 @@
19559
19571
  const downloading$ = createDownloadingState();
19560
19572
  dexie.cloud = {
19561
19573
  // @ts-ignore
19562
- version: "4.4.8",
19574
+ version: "4.4.10",
19563
19575
  options: Object.assign({}, DEFAULT_OPTIONS),
19564
19576
  schema: null,
19565
19577
  get currentUserId() {
@@ -19587,18 +19599,27 @@
19587
19599
  invites: getInvitesObservable(dexie),
19588
19600
  roles: getGlobalRolesObservable(dexie),
19589
19601
  configure(options) {
19590
- // Validate maxStringLength Infinity disables offloading, otherwise must be
19591
- // a finite number between 100 and the server limit (32768).
19602
+ // Validate largeStringThreshold (preferred) or maxStringLength (deprecated)
19603
+ // Infinity disables offloading, otherwise must be a finite number between 100
19604
+ // and the server limit (32768).
19592
19605
  // Minimum 100 prevents accidental offloading of primary keys and short strings
19593
19606
  // that would break sync.
19594
19607
  const MIN_STRING_LENGTH = 100;
19595
19608
  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}`);
19609
+ if (options.maxStringLength !== undefined) {
19610
+ console.warn('maxStringLength is deprecated, use largeStringThreshold instead');
19611
+ // If largeStringThreshold is not explicitly set, migrate to new name
19612
+ if (options.largeStringThreshold === undefined) {
19613
+ options = Object.assign(Object.assign({}, options), { largeStringThreshold: options.maxStringLength });
19614
+ }
19615
+ }
19616
+ const thresholdValue = options.largeStringThreshold;
19617
+ if (thresholdValue !== undefined &&
19618
+ thresholdValue !== Infinity &&
19619
+ (!Number.isFinite(thresholdValue) ||
19620
+ thresholdValue < MIN_STRING_LENGTH ||
19621
+ thresholdValue > MAX_SERVER_STRING_LENGTH)) {
19622
+ throw new Error(`largeStringThreshold must be Infinity or a finite number in [${MIN_STRING_LENGTH}, ${MAX_SERVER_STRING_LENGTH}]. Got: ${thresholdValue}`);
19602
19623
  }
19603
19624
  options = dexie.cloud.options = Object.assign(Object.assign({}, dexie.cloud.options), options);
19604
19625
  configuredProgramatically = true;
@@ -19995,7 +20016,7 @@
19995
20016
  }
19996
20017
  }
19997
20018
  // @ts-ignore
19998
- dexieCloud.version = "4.4.8";
20019
+ dexieCloud.version = "4.4.10";
19999
20020
  Dexie.Cloud = dexieCloud;
20000
20021
 
20001
20022
  // In case the SW lives for a while, let it reuse already opened connections: