@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.
@@ -139,7 +139,7 @@ var IDBStore = class _IDBStore {
139
139
  }
140
140
  return Promise.all(keys.map((key) => this.tx.objectStore(this.name).get(key)));
141
141
  }
142
- return this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getMany(keys));
142
+ return await this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getMany(keys));
143
143
  }
144
144
  async getAll(query, count) {
145
145
  if (this.tx) return this.tx.objectStore(this.name).getAll(query, count);
@@ -173,7 +173,7 @@ var IDBStore = class _IDBStore {
173
173
  }
174
174
  return Promise.all(keys.map((key) => this.tx.objectStore(this.name).index(index).getAll(key)));
175
175
  }
176
- return this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getAllFromIndexMany(index, keys));
176
+ return await this.owner.transaction([this.name], "readonly", (tx) => tx.readonly(this.name).getAllFromIndexMany(index, keys));
177
177
  }
178
178
  async count(query) {
179
179
  if (this.tx) return this.tx.objectStore(this.name).count(query);
@@ -324,30 +324,32 @@ var IndexedDBStorage = class {
324
324
  let pre20 = 0;
325
325
  let migrationError;
326
326
  this.opening = openDB(this.options.dbName ?? IDB_DB_NAME, DB_VERSION, {
327
- upgrade: async (db, oldVersion, _version, tx) => {
328
- void tx.done.catch(() => {
329
- });
330
- if (oldVersion > DB_VERSION) {
331
- newer = true;
332
- tx.abort();
333
- return;
334
- }
335
- if (oldVersion !== 0 && oldVersion < 20) {
336
- pre20 = oldVersion;
337
- tx.abort();
338
- return;
339
- }
340
- try {
341
- createMissingStores(db, tx);
342
- if (oldVersion !== 0 && oldVersion < DB_VERSION) this.options.onUpgradeStart?.(oldVersion);
343
- await migrateSchema(db, oldVersion, tx);
344
- } catch (error) {
345
- migrationError = error instanceof Error ? error : new Error(String(error));
346
- try {
327
+ upgrade: (db, oldVersion, _version, tx) => {
328
+ void (async () => {
329
+ void tx.done.catch(() => {
330
+ });
331
+ if (oldVersion > DB_VERSION) {
332
+ newer = true;
347
333
  tx.abort();
348
- } catch {
334
+ return;
349
335
  }
350
- }
336
+ if (oldVersion !== 0 && oldVersion < 20) {
337
+ pre20 = oldVersion;
338
+ tx.abort();
339
+ return;
340
+ }
341
+ try {
342
+ createMissingStores(db, tx);
343
+ if (oldVersion !== 0 && oldVersion < DB_VERSION) this.options.onUpgradeStart?.(oldVersion);
344
+ await migrateSchema(db, oldVersion, tx);
345
+ } catch (error) {
346
+ migrationError = error instanceof Error ? error : new Error(String(error));
347
+ try {
348
+ tx.abort();
349
+ } catch {
350
+ }
351
+ }
352
+ })();
351
353
  },
352
354
  blocking: () => {
353
355
  void this.close();