dexie 3.2.0 → 3.2.1-beta.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/CONTRIBUTING.md +1 -1
- package/README.md +10 -10
- package/dist/dexie.d.ts +35 -35
- package/dist/dexie.js +23 -5
- package/dist/dexie.js.map +1 -1
- package/dist/dexie.min.js +1 -1
- package/dist/dexie.min.js.map +1 -1
- package/dist/dexie.mjs +23 -5
- package/dist/dexie.mjs.map +1 -1
- package/dist/modern/dexie.min.mjs +1 -1
- package/dist/modern/dexie.min.mjs.map +1 -1
- package/dist/modern/dexie.mjs +23 -5
- package/dist/modern/dexie.mjs.map +1 -1
- package/package.json +1 -1
package/dist/modern/dexie.mjs
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* By David Fahlander, david.fahlander@gmail.com
|
|
6
6
|
*
|
|
7
|
-
* Version 3.2.
|
|
7
|
+
* Version 3.2.1-beta.1, Fri Nov 19 2021
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* https://dexie.org
|
|
10
10
|
*
|
|
11
11
|
* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
|
12
12
|
*/
|
|
@@ -1221,8 +1221,14 @@ function tempTransaction(db, mode, storeNames, fn) {
|
|
|
1221
1221
|
var trans = db._createTransaction(mode, storeNames, db._dbSchema);
|
|
1222
1222
|
try {
|
|
1223
1223
|
trans.create();
|
|
1224
|
+
db._state.PR1398_maxLoop = 3;
|
|
1224
1225
|
}
|
|
1225
1226
|
catch (ex) {
|
|
1227
|
+
if (ex.name === errnames.InvalidState && db.isOpen() && --db._state.PR1398_maxLoop > 0) {
|
|
1228
|
+
console.warn('Dexie: Need to reopen db');
|
|
1229
|
+
db._close();
|
|
1230
|
+
return db.open().then(() => tempTransaction(db, mode, storeNames, fn));
|
|
1231
|
+
}
|
|
1226
1232
|
return rejection(ex);
|
|
1227
1233
|
}
|
|
1228
1234
|
return trans._promise(mode, (resolve, reject) => {
|
|
@@ -1236,7 +1242,7 @@ function tempTransaction(db, mode, storeNames, fn) {
|
|
|
1236
1242
|
}
|
|
1237
1243
|
}
|
|
1238
1244
|
|
|
1239
|
-
const DEXIE_VERSION = '3.2.
|
|
1245
|
+
const DEXIE_VERSION = '3.2.1-beta.1';
|
|
1240
1246
|
const maxString = String.fromCharCode(65535);
|
|
1241
1247
|
const minKey = -Infinity;
|
|
1242
1248
|
const INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
|
|
@@ -3737,7 +3743,18 @@ function enterTransactionScope(db, mode, storeNames, parentTransaction, scopeFun
|
|
|
3737
3743
|
trans.idbtrans = parentTransaction.idbtrans;
|
|
3738
3744
|
}
|
|
3739
3745
|
else {
|
|
3740
|
-
|
|
3746
|
+
try {
|
|
3747
|
+
trans.create();
|
|
3748
|
+
db._state.PR1398_maxLoop = 3;
|
|
3749
|
+
}
|
|
3750
|
+
catch (ex) {
|
|
3751
|
+
if (ex.name === errnames.InvalidState && db.isOpen() && --db._state.PR1398_maxLoop > 0) {
|
|
3752
|
+
console.warn('Dexie: Need to reopen db');
|
|
3753
|
+
db._close();
|
|
3754
|
+
return db.open().then(() => enterTransactionScope(db, mode, storeNames, null, scopeFunc));
|
|
3755
|
+
}
|
|
3756
|
+
return rejection(ex);
|
|
3757
|
+
}
|
|
3741
3758
|
}
|
|
3742
3759
|
const scopeFuncIsAsync = isAsyncFunction(scopeFunc);
|
|
3743
3760
|
if (scopeFuncIsAsync) {
|
|
@@ -4507,7 +4524,8 @@ class Dexie$1 {
|
|
|
4507
4524
|
dbReadyPromise: null,
|
|
4508
4525
|
cancelOpen: nop,
|
|
4509
4526
|
openCanceller: null,
|
|
4510
|
-
autoSchema: true
|
|
4527
|
+
autoSchema: true,
|
|
4528
|
+
PR1398_maxLoop: 3
|
|
4511
4529
|
};
|
|
4512
4530
|
state.dbReadyPromise = new DexiePromise(resolve => {
|
|
4513
4531
|
state.dbReadyResolve = resolve;
|