indexeddbshim 17.4.3 → 17.6.0

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.
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v17.4.3 - 8/29/2026 */
1
+ /*! indexeddbshim - v17.6.0 - 9/1/2026 */
2
2
 
3
3
  (function (factory) {
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -5382,7 +5382,7 @@
5382
5382
  * __requestsFinished: boolean,
5383
5383
  * __transFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
5384
5384
  * __callTransFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
5385
- * __transactionEndCallback: () => void,
5385
+ * __transactionEndCallback: (() => void)|undefined,
5386
5386
  * __transactionFinished: boolean,
5387
5387
  * __completed: boolean,
5388
5388
  * __transFinishedCbFired: boolean,
@@ -5417,6 +5417,19 @@
5417
5417
  * }} IDBTransactionFull
5418
5418
  */
5419
5419
 
5420
+ /**
5421
+ * @param {IDBTransactionFull} tx
5422
+ * @returns {void}
5423
+ */
5424
+ function releaseFinishedTransaction(tx) {
5425
+ var pos = tx.db.__transactions.indexOf(tx);
5426
+ if (pos !== -1) {
5427
+ tx.db.__transactions.splice(pos, 1);
5428
+ }
5429
+ tx.__transactionEndCallback = undefined;
5430
+ tx.__requests = [];
5431
+ }
5432
+
5420
5433
  /**
5421
5434
  * The IndexedDB Transaction.
5422
5435
  * @see https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransaction
@@ -5981,6 +5994,7 @@
5981
5994
  } finally {
5982
5995
  activeTransactions.delete(me);
5983
5996
  me.__storeHandles = {};
5997
+ releaseFinishedTransaction(me);
5984
5998
  }
5985
5999
  }
5986
6000
  if (me.mode === 'readwrite' || me.mode === 'readonly') {
@@ -6267,6 +6281,7 @@
6267
6281
  me.dispatchEvent(evt);
6268
6282
  me.__storeHandles = {};
6269
6283
  me.dispatchEvent(createEvent('__abort'));
6284
+ releaseFinishedTransaction(me);
6270
6285
  }, 0);
6271
6286
  return undefined;
6272
6287
  }).catch(function (err) {
@@ -11254,9 +11269,7 @@
11254
11269
  /**
11255
11270
  * @typedef {import('websql-configurable/lib/websql/WebSQLDatabase.js').default & {
11256
11271
  * _db: {
11257
- * _db: {
11258
- * close: (errBack: (err: Error) => void) => void
11259
- * }
11272
+ * close: (errBack: (err: Error) => void) => void
11260
11273
  * }
11261
11274
  * }} DatabaseFull
11262
11275
  */
@@ -11334,7 +11347,7 @@
11334
11347
  return;
11335
11348
  }
11336
11349
  dbs.forEach(function (db) {
11337
- var sqliteDB = db._db && db._db._db;
11350
+ var sqliteDB = db._db;
11338
11351
  if (!sqliteDB || !sqliteDB.close) {
11339
11352
  remaining--;
11340
11353
  if (remaining === 0) {
@@ -11376,9 +11389,9 @@
11376
11389
  databaseDeleted();
11377
11390
  return;
11378
11391
  }
11379
- var _sqliteDB = latestSQLiteDBCached._db && latestSQLiteDBCached._db._db;
11392
+ var _sqliteDB = latestSQLiteDBCached._db;
11380
11393
  if (!_sqliteDB || !_sqliteDB.close) {
11381
- console.error('The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database');
11394
+ console.error('The `openDatabase` implementation does not have the expected `._db.close` method for closing the database');
11382
11395
  return;
11383
11396
  }
11384
11397
  _sqliteDB.close(
@@ -12183,7 +12196,7 @@
12183
12196
  var calledDbCreateError = false;
12184
12197
  // Snapshotted *now*, synchronously, at call time -- not read later
12185
12198
  // from inside the SQL query's callback below, which runs on a
12186
- // deferred macrotask (see `nodeSQLiteDatabase.js`'s `exec`) and so
12199
+ // deferred macrotask (see `websql-configurable`'s `SQLiteDatabase#exec`) and so
12187
12200
  // could otherwise race against (and lose to) an in-flight upgrade's
12188
12201
  // own commit/abort handler clearing its `pendingVersionChanges`
12189
12202
  // entry in the meantime -- which would make this method incorrectly