@bitcobblers/wod-wiki-storage 0.59.2243 → 0.59.2245

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.
@@ -540,7 +540,7 @@ var IDBStore = class _IDBStore {
540
540
  }
541
541
  return Promise.all(keys.map((key) => this.tx.objectStore(this.name).get(key)));
542
542
  }
543
- return this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getMany(keys));
543
+ return await this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getMany(keys));
544
544
  }
545
545
  async getAll(query, count) {
546
546
  if (this.tx) return this.tx.objectStore(this.name).getAll(query, count);
@@ -574,7 +574,7 @@ var IDBStore = class _IDBStore {
574
574
  }
575
575
  return Promise.all(keys.map((key) => this.tx.objectStore(this.name).index(index).getAll(key)));
576
576
  }
577
- return this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getAllFromIndexMany(index, keys));
577
+ return await this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getAllFromIndexMany(index, keys));
578
578
  }
579
579
  async count(query) {
580
580
  if (this.tx) return this.tx.objectStore(this.name).count(query);
@@ -725,30 +725,32 @@ var IndexedDBStorage = class {
725
725
  let pre20 = 0;
726
726
  let migrationError;
727
727
  this.opening = idb.openDB(this.options.dbName ?? IDB_DB_NAME, DB_VERSION, {
728
- upgrade: async (db, oldVersion, _version, tx) => {
729
- void tx.done.catch(() => {
730
- });
731
- if (oldVersion > DB_VERSION) {
732
- newer = true;
733
- tx.abort();
734
- return;
735
- }
736
- if (oldVersion !== 0 && oldVersion < 20) {
737
- pre20 = oldVersion;
738
- tx.abort();
739
- return;
740
- }
741
- try {
742
- createMissingStores(db, tx);
743
- if (oldVersion !== 0 && oldVersion < DB_VERSION) this.options.onUpgradeStart?.(oldVersion);
744
- await migrateSchema(db, oldVersion, tx);
745
- } catch (error) {
746
- migrationError = error instanceof Error ? error : new Error(String(error));
747
- try {
728
+ upgrade: (db, oldVersion, _version, tx) => {
729
+ void (async () => {
730
+ void tx.done.catch(() => {
731
+ });
732
+ if (oldVersion > DB_VERSION) {
733
+ newer = true;
748
734
  tx.abort();
749
- } catch {
735
+ return;
750
736
  }
751
- }
737
+ if (oldVersion !== 0 && oldVersion < 20) {
738
+ pre20 = oldVersion;
739
+ tx.abort();
740
+ return;
741
+ }
742
+ try {
743
+ createMissingStores(db, tx);
744
+ if (oldVersion !== 0 && oldVersion < DB_VERSION) this.options.onUpgradeStart?.(oldVersion);
745
+ await migrateSchema(db, oldVersion, tx);
746
+ } catch (error) {
747
+ migrationError = error instanceof Error ? error : new Error(String(error));
748
+ try {
749
+ tx.abort();
750
+ } catch {
751
+ }
752
+ }
753
+ })();
752
754
  },
753
755
  blocking: () => {
754
756
  void this.close();