@bitcobblers/wod-wiki-storage 0.59.2243 → 0.59.2244

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.
@@ -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();