dexie 4.4.6 → 4.4.7

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.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.4.6, Thu Sep 10 2026
7
+ * Version 4.4.7, Mon Oct 19 2026
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1170,7 +1170,7 @@ function tempTransaction(db, mode, storeNames, fn) {
1170
1170
  }
1171
1171
  }
1172
1172
 
1173
- const DEXIE_VERSION = '4.4.6';
1173
+ const DEXIE_VERSION = '4.4.7';
1174
1174
  const maxString = String.fromCharCode(65535);
1175
1175
  const minKey = -Infinity;
1176
1176
  const INVALID_KEY_ARGUMENT = 'Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.';
@@ -1708,27 +1708,23 @@ class Table {
1708
1708
  });
1709
1709
  }
1710
1710
  bulkUpdate(keysAndChanges) {
1711
- const coreTable = this.core;
1712
1711
  const keys = keysAndChanges.map((entry) => entry.key);
1713
1712
  const changeSpecs = keysAndChanges.map((entry) => entry.changes);
1714
1713
  const offsetMap = [];
1715
1714
  return this._trans('readwrite', (trans) => {
1715
+ const coreTable = this.core;
1716
1716
  return coreTable.getMany({ trans, keys, cache: 'clone' }).then((objs) => {
1717
+ const { outbound, extractKey } = coreTable.schema.primaryKey;
1717
1718
  const resultKeys = [];
1718
1719
  const resultObjs = [];
1719
1720
  keysAndChanges.forEach(({ key, changes }, idx) => {
1720
1721
  const obj = objs[idx];
1721
1722
  if (obj) {
1722
1723
  for (const keyPath of Object.keys(changes)) {
1723
- const value = changes[keyPath];
1724
- if (keyPath === this.schema.primKey.keyPath) {
1725
- if (cmp(value, key) !== 0) {
1726
- throw new exceptions.Constraint(`Cannot update primary key in bulkUpdate()`);
1727
- }
1728
- }
1729
- else {
1730
- setByKeyPath(obj, keyPath, value);
1731
- }
1724
+ setByKeyPath(obj, keyPath, changes[keyPath]);
1725
+ }
1726
+ if (!outbound && cmp(extractKey(obj), key) !== 0) {
1727
+ throw new exceptions.Constraint(`Cannot update primary key in bulkUpdate()`);
1732
1728
  }
1733
1729
  offsetMap.push(idx);
1734
1730
  resultKeys.push(key);
@@ -2438,7 +2434,9 @@ function fail(collectionOrWhereClause, err, T) {
2438
2434
  return collection;
2439
2435
  }
2440
2436
  function emptyCollection(whereClause) {
2441
- return new whereClause.Collection(whereClause, () => rangeEqual('')).limit(0);
2437
+ const collection = new whereClause.Collection(whereClause, () => rangeEqual(''));
2438
+ collection._addAlgorithm(() => false);
2439
+ return collection;
2442
2440
  }
2443
2441
  function upperFactory(dir) {
2444
2442
  return dir === 'next'
@@ -4385,11 +4383,12 @@ function dexieOpen(db) {
4385
4383
  }
4386
4384
  return DexiePromise.reject(err);
4387
4385
  });
4386
+ const useSafari14Workaround = typeof navigator !== 'undefined' &&
4387
+ !!indexedDB &&
4388
+ indexedDB === _global.indexedDB;
4388
4389
  return DexiePromise.race([
4389
4390
  openCanceller,
4390
- (typeof navigator === 'undefined'
4391
- ? DexiePromise.resolve()
4392
- : idbReady()).then(tryOpenDB),
4391
+ (useSafari14Workaround ? idbReady() : DexiePromise.resolve()).then(tryOpenDB),
4393
4392
  ])
4394
4393
  .then(() => {
4395
4394
  throwIfCancelled();
@@ -5010,7 +5009,7 @@ const observabilityMiddleware = {
5010
5009
  ? [req.keys]
5011
5010
  : req.values.length < 50
5012
5011
  ? [
5013
- getEffectiveKeys(primaryKey, req).filter((id) => id),
5012
+ getEffectiveKeys(primaryKey, req).filter((id) => id != null),
5014
5013
  req.values,
5015
5014
  ]
5016
5015
  : [];
@@ -5923,7 +5922,7 @@ let Dexie$1 = class Dexie {
5923
5922
  }
5924
5923
  hasBeenClosed() {
5925
5924
  const dbOpenError = this._state.dbOpenError;
5926
- return dbOpenError && dbOpenError.name === 'DatabaseClosed';
5925
+ return dbOpenError && dbOpenError.name === 'DatabaseClosedError';
5927
5926
  }
5928
5927
  hasFailed() {
5929
5928
  return this._state.dbOpenError !== null;
@@ -6133,6 +6132,9 @@ function liveQuery(querier) {
6133
6132
  }
6134
6133
  }
6135
6134
  }, (err) => {
6135
+ if (closed || ctx.signal.aborted) {
6136
+ return;
6137
+ }
6136
6138
  hasValue = false;
6137
6139
  if (!['DatabaseClosedError', 'AbortError'].includes(err?.name)) {
6138
6140
  if (!closed)