indexeddbshim 17.2.0 → 17.2.1
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/IDBFactory.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 +10 -3
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +10 -3
- 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 +10 -3
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +10 -3
- 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 +10 -3
- 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 +3 -4
- package/src/IDBFactory.js +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indexeddbshim",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Parashuram <code@nparashuram.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"web-platform-tests/**",
|
|
22
22
|
"coverage",
|
|
23
23
|
"ignore",
|
|
24
|
-
".
|
|
25
|
-
".mocharc.
|
|
24
|
+
"eslint.config.js",
|
|
25
|
+
".mocharc.js",
|
|
26
26
|
"tests-mocha/**",
|
|
27
27
|
"tests-polyfill/**",
|
|
28
28
|
"test-support/**"
|
|
@@ -210,7 +210,6 @@
|
|
|
210
210
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
211
211
|
"sinon": "^22.1.0",
|
|
212
212
|
"source-map-support": "0.5.21",
|
|
213
|
-
"sourcemap-transformer": "git+https://github.com/brettz9/sourcemap-transformer.git",
|
|
214
213
|
"typescript": "^6.0.3",
|
|
215
214
|
"w3c-blob": "0.0.1",
|
|
216
215
|
"ws": "^8.21.3"
|
package/src/IDBFactory.js
CHANGED
|
@@ -856,9 +856,17 @@ IDBFactory.prototype.deleteDatabase = function (name) {
|
|
|
856
856
|
* @returns {boolean}
|
|
857
857
|
*/
|
|
858
858
|
function dbError (tx, err) {
|
|
859
|
-
if (calledDBError
|
|
859
|
+
if (calledDBError) {
|
|
860
860
|
return false;
|
|
861
861
|
}
|
|
862
|
+
// Must be set synchronously (not inside the `sysdbFinishedCbDelete` callback below) to
|
|
863
|
+
// guard against reentrancy: `sysdbFinishedCbDelete` -> `rollback`/`commit` -> websql-configurable's
|
|
864
|
+
// `done()` -> `currentTask.errorCallback(er)`, which is this very `dbError`, calling back into
|
|
865
|
+
// us before the first invocation has finished. Without this, a second rollback/commit gets
|
|
866
|
+
// issued on the shared `sysdb` connection after it has already moved on to the next queued
|
|
867
|
+
// transaction, corrupting that connection's task queue (see issue with unrelated `open()` calls
|
|
868
|
+
// failing/crashing after a `deleteDatabase` file-removal error).
|
|
869
|
+
calledDBError = true;
|
|
862
870
|
const er = webSQLErrback(/** @type {SQLError} */ (err || tx));
|
|
863
871
|
sysdbFinishedCbDelete(true, function () {
|
|
864
872
|
req.__done = true;
|
|
@@ -867,7 +875,6 @@ IDBFactory.prototype.deleteDatabase = function (name) {
|
|
|
867
875
|
// Re: why bubbling here (and how cancelable is only really relevant for `window.onerror`) see: https://github.com/w3c/IndexedDB/issues/86
|
|
868
876
|
const e = createEvent('error', er, {bubbles: true, cancelable: true});
|
|
869
877
|
req.dispatchEvent(e);
|
|
870
|
-
calledDBError = true;
|
|
871
878
|
});
|
|
872
879
|
return false;
|
|
873
880
|
}
|