indexeddbshim 19.0.4 → 19.0.5
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.
- package/dist/IDBTransaction.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +1 -1
- package/dist/indexeddbshim-Key.min.js +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +15 -9
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +15 -9
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +15 -9
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +15 -9
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +2 -2
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +15 -9
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/package.json +1 -1
- package/src/IDBTransaction.js +14 -8
package/package.json
CHANGED
package/src/IDBTransaction.js
CHANGED
|
@@ -297,6 +297,10 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
297
297
|
let q,
|
|
298
298
|
i = -1;
|
|
299
299
|
|
|
300
|
+
// On a standard driver, `keepAliveAndWait` issues a SQL query, which
|
|
301
|
+
// is a macrotask. Otherwise it issues ten microtasks.
|
|
302
|
+
const keepAliveAttempts = isStandardDriver ? 1 : 10;
|
|
303
|
+
|
|
300
304
|
/**
|
|
301
305
|
* A continuation that must still be able to observe the
|
|
302
306
|
* transaction as safe to extend (e.g., re-checking whether an
|
|
@@ -332,9 +336,9 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
332
336
|
});
|
|
333
337
|
} catch (err) {
|
|
334
338
|
// The driver has already finalized the transaction (or otherwise
|
|
335
|
-
// rejected the call) -- nothing left to hold open
|
|
336
|
-
//
|
|
337
|
-
|
|
339
|
+
// rejected the call) -- nothing left to hold open. We explicitly
|
|
340
|
+
// abort the transaction here.
|
|
341
|
+
me.__abortTransaction(/** @type {Error|DOMException} */ (err));
|
|
338
342
|
}
|
|
339
343
|
}
|
|
340
344
|
|
|
@@ -530,9 +534,11 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
530
534
|
* consumer of that same handler (e.g. one that resolves a
|
|
531
535
|
* promise from within `onsuccess` and only attaches `oncomplete`
|
|
532
536
|
* afterward) ever gets a turn to run, so it can miss `complete`
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
537
|
+
* afterward) ever gets a turn to run, so it can miss `complete`
|
|
538
|
+
* entirely. On a non-standard driver, `readonly` requests don't hold
|
|
539
|
+
* a real SQL transaction open, so there's no file-lock/connection
|
|
540
|
+
* collision risk. On a standard driver, the wait now issues real SQL
|
|
541
|
+
* inside the read transaction, so this does carry a slight risk.
|
|
536
542
|
* @param {number} attemptsLeft
|
|
537
543
|
* @returns {void}
|
|
538
544
|
*/
|
|
@@ -567,7 +573,7 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
567
573
|
}
|
|
568
574
|
i++;
|
|
569
575
|
if (i >= me.__requests.length) {
|
|
570
|
-
checkQueueEntry(
|
|
576
|
+
checkQueueEntry(keepAliveAttempts);
|
|
571
577
|
return;
|
|
572
578
|
}
|
|
573
579
|
runQueuedRequest();
|
|
@@ -604,7 +610,7 @@ IDBTransaction.prototype.__executeRequests = function () {
|
|
|
604
610
|
}
|
|
605
611
|
i++;
|
|
606
612
|
if (i >= me.__requests.length) {
|
|
607
|
-
checkQueueEntry(
|
|
613
|
+
checkQueueEntry(keepAliveAttempts);
|
|
608
614
|
return;
|
|
609
615
|
}
|
|
610
616
|
keepAliveAndWait(() => {
|