dexie 4.0.1-alpha.20 → 4.0.1-alpha.21

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.0.1-alpha.20, Mon Jun 12 2023
7
+ * Version 4.0.1-alpha.21+test1, Wed Jun 14 2023
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1226,7 +1226,7 @@ function tempTransaction(db, mode, storeNames, fn) {
1226
1226
  }
1227
1227
  }
1228
1228
 
1229
- const DEXIE_VERSION = '4.0.1-alpha.20';
1229
+ const DEXIE_VERSION = '4.0.1-alpha.21+test1';
1230
1230
  const maxString = String.fromCharCode(65535);
1231
1231
  const minKey = -Infinity;
1232
1232
  const INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -4491,9 +4491,6 @@ const observabilityMiddleware = {
4491
4491
  ? req.obsSet = {}
4492
4492
  : subscr;
4493
4493
  if (isLiveQuery) {
4494
- const { signal } = PSD;
4495
- if (signal && signal.aborted)
4496
- throw new exceptions.Abort();
4497
4494
  const getRangeSet = (indexName) => {
4498
4495
  const part = `idb://${dbName}/${tableName}/${indexName}`;
4499
4496
  return (obsSet[part] ||
@@ -4839,15 +4836,10 @@ const cacheMiddleware = {
4839
4836
  ...core,
4840
4837
  transaction: (stores, mode, options) => {
4841
4838
  const idbtrans = core.transaction(stores, mode, options);
4842
- const { txs } = PSD;
4843
- if (txs || mode === 'readwrite') {
4844
- if (txs)
4845
- txs.push(idbtrans);
4839
+ if (mode === 'readwrite') {
4846
4840
  const ac = new AbortController();
4847
4841
  const { signal } = ac;
4848
4842
  const endTransaction = (wasCommitted) => () => {
4849
- if (txs)
4850
- delArrayItem(txs, idbtrans);
4851
4843
  ac.abort();
4852
4844
  if (mode === 'readwrite') {
4853
4845
  const affectedSubscribers = new Set();
@@ -4975,13 +4967,7 @@ const cacheMiddleware = {
4975
4967
  });
4976
4968
  cacheEntry = {
4977
4969
  obsSet: req.obsSet,
4978
- promise: promise.catch(error => {
4979
- if (req.trans.aborted) {
4980
- const trans = coreMW.transaction([tableName], 'readonly');
4981
- return tableMW.query({ ...req, trans });
4982
- }
4983
- return Promise.reject(error);
4984
- }),
4970
+ promise,
4985
4971
  subscribers: new Set(),
4986
4972
  type: 'query',
4987
4973
  req,
@@ -5362,7 +5348,6 @@ function liveQuery(querier) {
5362
5348
  }
5363
5349
  let closed = false;
5364
5350
  let abortController;
5365
- const txs = [];
5366
5351
  let accumMuts = {};
5367
5352
  let currentObs = {};
5368
5353
  const subscription = {
@@ -5377,13 +5362,6 @@ function liveQuery(querier) {
5377
5362
  abortController.abort();
5378
5363
  if (startedListening)
5379
5364
  globalEvents.storagemutated.unsubscribe(mutationListener);
5380
- txs.forEach(idbtrans => {
5381
- idbtrans.aborted = true;
5382
- try {
5383
- idbtrans.abort();
5384
- }
5385
- catch (_a) { }
5386
- });
5387
5365
  },
5388
5366
  };
5389
5367
  observer.start && observer.start(subscription);
@@ -5408,19 +5386,8 @@ function liveQuery(querier) {
5408
5386
  if (abortController)
5409
5387
  abortController.abort();
5410
5388
  abortController = new AbortController();
5411
- if (txs.length) {
5412
- txs.forEach(idbtrans => {
5413
- idbtrans.aborted = true;
5414
- try {
5415
- idbtrans.abort();
5416
- }
5417
- catch (_a) { }
5418
- });
5419
- txs.length = 0;
5420
- }
5421
5389
  const ctx = {
5422
5390
  subscr,
5423
- txs,
5424
5391
  signal: abortController.signal,
5425
5392
  requery: doQuery,
5426
5393
  trans: null