http-request-manager 18.13.7 → 18.13.9
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.
|
@@ -6179,15 +6179,14 @@ class DbService extends Dexie {
|
|
|
6179
6179
|
}
|
|
6180
6180
|
getTable(tableName) {
|
|
6181
6181
|
try {
|
|
6182
|
-
return this.table(
|
|
6182
|
+
return this.table(tableName);
|
|
6183
6183
|
}
|
|
6184
6184
|
catch (error) {
|
|
6185
6185
|
return undefined;
|
|
6186
6186
|
}
|
|
6187
6187
|
}
|
|
6188
6188
|
tableExists(tableName) {
|
|
6189
|
-
|
|
6190
|
-
return this.tables.some(t => t.name === safe);
|
|
6189
|
+
return this.tables.some(t => t.name === tableName);
|
|
6191
6190
|
}
|
|
6192
6191
|
async updateTable(tableName, find, data) {
|
|
6193
6192
|
const table = this.getTable(tableName);
|
|
@@ -6210,9 +6209,7 @@ class DbService extends Dexie {
|
|
|
6210
6209
|
const safeSchema = schema.trim();
|
|
6211
6210
|
const currentSchema = this.getCurrentSchema();
|
|
6212
6211
|
const existingSchema = currentSchema[safeTableName]?.trim();
|
|
6213
|
-
|
|
6214
|
-
const normalize = (s) => (s ?? '').replace(/\s+/g, '');
|
|
6215
|
-
if (this.tableExists(safeTableName) && normalize(existingSchema) === normalize(safeSchema)) {
|
|
6212
|
+
if (this.tableExists(safeTableName) && existingSchema === safeSchema) {
|
|
6216
6213
|
return;
|
|
6217
6214
|
}
|
|
6218
6215
|
console.log('Current Schema before update:', currentSchema);
|
|
@@ -6223,8 +6220,9 @@ class DbService extends Dexie {
|
|
|
6223
6220
|
this.close();
|
|
6224
6221
|
}
|
|
6225
6222
|
this.version(nextVersion).stores(currentSchema);
|
|
6223
|
+
this.dbReady = this.open();
|
|
6226
6224
|
try {
|
|
6227
|
-
await this.
|
|
6225
|
+
await this.dbReady;
|
|
6228
6226
|
const created = this.tables.some(t => t.name === safeTableName);
|
|
6229
6227
|
if (!created) {
|
|
6230
6228
|
console.error(`CRITICAL: Table ${safeTableName} was NOT created after upgrade! Tables found:`, this.tables.map(t => t.name));
|
|
@@ -6430,8 +6428,8 @@ class DatabaseManagerService extends DbService {
|
|
|
6430
6428
|
const tableName = this.cleanTableName(table);
|
|
6431
6429
|
return this.getDatabaseTable(tableName).pipe(switchMap((tableData) => {
|
|
6432
6430
|
if (!tableData) {
|
|
6433
|
-
console.warn(`updateTableRecords:
|
|
6434
|
-
return
|
|
6431
|
+
console.warn(`updateTableRecords: Table '${tableName}' not found`);
|
|
6432
|
+
return EMPTY;
|
|
6435
6433
|
}
|
|
6436
6434
|
const insertRecords = records.map((record) => {
|
|
6437
6435
|
const payload = { ...(record || {}) };
|