http-request-manager 18.13.8 → 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();
@@ -6239,22 +6242,12 @@ class DbService extends Dexie {
6239
6242
  async DBOpened() {
6240
6243
  try {
6241
6244
  await this.dbReady;
6245
+ return this.isOpen();
6242
6246
  }
6243
6247
  catch (err) {
6244
6248
  console.error('DBOpened: init failed', err);
6245
6249
  return false;
6246
6250
  }
6247
- if (!this.isOpen()) {
6248
- try {
6249
- await this.open();
6250
- return true;
6251
- }
6252
- catch (err) {
6253
- console.error('DBOpened: open failed', err);
6254
- return false;
6255
- }
6256
- }
6257
- return true;
6258
6251
  }
6259
6252
  getCurrentSchema() {
6260
6253
  const schema = {};
@@ -6426,6 +6419,10 @@ class DatabaseManagerService extends DbService {
6426
6419
  updateTableRecords(table, records) {
6427
6420
  const tableName = this.cleanTableName(table);
6428
6421
  return this.getDatabaseTable(tableName).pipe(switchMap((tableData) => {
6422
+ if (!tableData) {
6423
+ console.warn(`updateTableRecords: Table '${tableName}' not found`);
6424
+ return EMPTY;
6425
+ }
6429
6426
  const insertRecords = records.map((record) => {
6430
6427
  const payload = { ...(record || {}) };
6431
6428
  if (payload.id === undefined || payload.id === null || payload.id === '') {