http-request-manager 18.13.9 → 18.13.10
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.
|
@@ -6204,7 +6204,10 @@ class DbService extends Dexie {
|
|
|
6204
6204
|
async createTable(tableName, schema) {
|
|
6205
6205
|
if (!tableName || !schema)
|
|
6206
6206
|
return;
|
|
6207
|
+
this.dbReady = this.dbReady.then(() => this._doCreateTable(tableName, schema));
|
|
6207
6208
|
await this.dbReady;
|
|
6209
|
+
}
|
|
6210
|
+
async _doCreateTable(tableName, schema) {
|
|
6208
6211
|
const safeTableName = this.cleanTableName(tableName);
|
|
6209
6212
|
const safeSchema = schema.trim();
|
|
6210
6213
|
const currentSchema = this.getCurrentSchema();
|
|
@@ -6220,9 +6223,8 @@ class DbService extends Dexie {
|
|
|
6220
6223
|
this.close();
|
|
6221
6224
|
}
|
|
6222
6225
|
this.version(nextVersion).stores(currentSchema);
|
|
6223
|
-
this.dbReady = this.open();
|
|
6224
6226
|
try {
|
|
6225
|
-
await this.
|
|
6227
|
+
await this.open();
|
|
6226
6228
|
const created = this.tables.some(t => t.name === safeTableName);
|
|
6227
6229
|
if (!created) {
|
|
6228
6230
|
console.error(`CRITICAL: Table ${safeTableName} was NOT created after upgrade! Tables found:`, this.tables.map(t => t.name));
|
|
@@ -6240,22 +6242,12 @@ class DbService extends Dexie {
|
|
|
6240
6242
|
async DBOpened() {
|
|
6241
6243
|
try {
|
|
6242
6244
|
await this.dbReady;
|
|
6245
|
+
return this.isOpen();
|
|
6243
6246
|
}
|
|
6244
6247
|
catch (err) {
|
|
6245
6248
|
console.error('DBOpened: init failed', err);
|
|
6246
6249
|
return false;
|
|
6247
6250
|
}
|
|
6248
|
-
if (!this.isOpen()) {
|
|
6249
|
-
try {
|
|
6250
|
-
await this.open();
|
|
6251
|
-
return true;
|
|
6252
|
-
}
|
|
6253
|
-
catch (err) {
|
|
6254
|
-
console.error('DBOpened: open failed', err);
|
|
6255
|
-
return false;
|
|
6256
|
-
}
|
|
6257
|
-
}
|
|
6258
|
-
return true;
|
|
6259
6251
|
}
|
|
6260
6252
|
getCurrentSchema() {
|
|
6261
6253
|
const schema = {};
|