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) :
@@ -5395,7 +5395,7 @@
5395
5395
  * __requestsFinished: boolean,
5396
5396
  * __transFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
5397
5397
  * __callTransFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
5398
- * __transactionEndCallback: () => void,
5398
+ * __transactionEndCallback: (() => void)|undefined,
5399
5399
  * __transactionFinished: boolean,
5400
5400
  * __completed: boolean,
5401
5401
  * __transFinishedCbFired: boolean,
@@ -5430,6 +5430,19 @@
5430
5430
  * }} IDBTransactionFull
5431
5431
  */
5432
5432
 
5433
+ /**
5434
+ * @param {IDBTransactionFull} tx
5435
+ * @returns {void}
5436
+ */
5437
+ function releaseFinishedTransaction(tx) {
5438
+ var pos = tx.db.__transactions.indexOf(tx);
5439
+ if (pos !== -1) {
5440
+ tx.db.__transactions.splice(pos, 1);
5441
+ }
5442
+ tx.__transactionEndCallback = undefined;
5443
+ tx.__requests = [];
5444
+ }
5445
+
5433
5446
  /**
5434
5447
  * The IndexedDB Transaction.
5435
5448
  * @see https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransaction
@@ -5994,6 +6007,7 @@
5994
6007
  } finally {
5995
6008
  activeTransactions.delete(me);
5996
6009
  me.__storeHandles = {};
6010
+ releaseFinishedTransaction(me);
5997
6011
  }
5998
6012
  }
5999
6013
  if (me.mode === 'readwrite' || me.mode === 'readonly') {
@@ -6280,6 +6294,7 @@
6280
6294
  me.dispatchEvent(evt);
6281
6295
  me.__storeHandles = {};
6282
6296
  me.dispatchEvent(createEvent('__abort'));
6297
+ releaseFinishedTransaction(me);
6283
6298
  }, 0);
6284
6299
  return undefined;
6285
6300
  }).catch(function (err) {
@@ -11267,9 +11282,7 @@
11267
11282
  /**
11268
11283
  * @typedef {import('websql-configurable/lib/websql/WebSQLDatabase.js').default & {
11269
11284
  * _db: {
11270
- * _db: {
11271
- * close: (errBack: (err: Error) => void) => void
11272
- * }
11285
+ * close: (errBack: (err: Error) => void) => void
11273
11286
  * }
11274
11287
  * }} DatabaseFull
11275
11288
  */
@@ -11347,7 +11360,7 @@
11347
11360
  return;
11348
11361
  }
11349
11362
  dbs.forEach(function (db) {
11350
- var sqliteDB = db._db && db._db._db;
11363
+ var sqliteDB = db._db;
11351
11364
  if (!sqliteDB || !sqliteDB.close) {
11352
11365
  remaining--;
11353
11366
  if (remaining === 0) {
@@ -11389,9 +11402,9 @@
11389
11402
  databaseDeleted();
11390
11403
  return;
11391
11404
  }
11392
- var _sqliteDB = latestSQLiteDBCached._db && latestSQLiteDBCached._db._db;
11405
+ var _sqliteDB = latestSQLiteDBCached._db;
11393
11406
  if (!_sqliteDB || !_sqliteDB.close) {
11394
- console.error('The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database');
11407
+ console.error('The `openDatabase` implementation does not have the expected `._db.close` method for closing the database');
11395
11408
  return;
11396
11409
  }
11397
11410
  _sqliteDB.close(
@@ -12196,7 +12209,7 @@
12196
12209
  var calledDbCreateError = false;
12197
12210
  // Snapshotted *now*, synchronously, at call time -- not read later
12198
12211
  // from inside the SQL query's callback below, which runs on a
12199
- // deferred macrotask (see `nodeSQLiteDatabase.js`'s `exec`) and so
12212
+ // deferred macrotask (see `websql-configurable`'s `SQLiteDatabase#exec`) and so
12200
12213
  // could otherwise race against (and lose to) an in-flight upgrade's
12201
12214
  // own commit/abort handler clearing its `pendingVersionChanges`
12202
12215
  // entry in the meantime -- which would make this method incorrectly