diff options
author | Florian Dold <florian@dold.me> | 2021-02-22 21:03:06 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-02-22 21:03:06 +0100 |
commit | 9b9df089cfddb2f01b17ac0eaccd2192a6982fb9 (patch) | |
tree | b425933adc2917e045701e7c666bb17647087073 /packages/idb-bridge/src/bridge-idb.ts | |
parent | f0d820d8c6492cc490e4128f744544999933146b (diff) | |
download | wallet-core-9b9df089cfddb2f01b17ac0eaccd2192a6982fb9.tar.xz |
idb: fix test
Diffstat (limited to 'packages/idb-bridge/src/bridge-idb.ts')
-rw-r--r-- | packages/idb-bridge/src/bridge-idb.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/idb-bridge/src/bridge-idb.ts b/packages/idb-bridge/src/bridge-idb.ts index 02fca9d1e..836f2efa4 100644 --- a/packages/idb-bridge/src/bridge-idb.ts +++ b/packages/idb-bridge/src/bridge-idb.ts @@ -936,10 +936,6 @@ export class BridgeIDBFactory { await transaction._waitDone(); - // We don't explicitly exit the versionchange transaction, - // since this is already done by the BridgeIDBTransaction. - db._upgradeTransaction = null; - // We re-use the same transaction (as per spec) here. transaction._active = true; @@ -2425,6 +2421,11 @@ export class BridgeIDBTransaction if (this._backendTransaction) { await this._backend.commit(this._backendTransaction); } + + // We must exit the upgrade transaction here, so that the "complete" + // event handler can already do other transactions. + this._db._upgradeTransaction = null; + this._committed = true; if (!this._error) { if (BridgeIDBFactory.enableTracing) { |