[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/02: idb-bridge: avoid unhandled rejection when cl
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/02: idb-bridge: avoid unhandled rejection when closing DB |
Date: |
Wed, 15 Dec 2021 02:58:41 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
commit f4d66541ed58ac71e0f8218be8ff210cdc024cb4
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Dec 15 02:58:36 2021 +0100
idb-bridge: avoid unhandled rejection when closing DB
---
packages/idb-bridge/src/MemoryBackend.ts | 10 ++++++----
packages/idb-bridge/src/bridge-idb.ts | 4 ++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/packages/idb-bridge/src/MemoryBackend.ts
b/packages/idb-bridge/src/MemoryBackend.ts
index de4bca88..99d5b796 100644
--- a/packages/idb-bridge/src/MemoryBackend.ts
+++ b/packages/idb-bridge/src/MemoryBackend.ts
@@ -562,10 +562,12 @@ export class MemoryBackend implements Backend {
throw Error("connection not found - already closed?");
}
const myDb = this.databases[myConn.dbName];
- // FIXME: what if we're still in a transaction?
- myDb.connectionCookies = myDb.connectionCookies.filter(
- (x) => x != conn.connectionCookie,
- );
+ if (myDb) {
+ // FIXME: what if we're still in a transaction?
+ myDb.connectionCookies = myDb.connectionCookies.filter(
+ (x) => x != conn.connectionCookie,
+ );
+ }
delete this.connections[conn.connectionCookie];
this.disconnectCond.trigger();
}
diff --git a/packages/idb-bridge/src/bridge-idb.ts
b/packages/idb-bridge/src/bridge-idb.ts
index 9ea258fd..5d5f531b 100644
--- a/packages/idb-bridge/src/bridge-idb.ts
+++ b/packages/idb-bridge/src/bridge-idb.ts
@@ -2655,13 +2655,13 @@ export class BridgeIDBTransaction
}
}
- await waitMacroQueue();
-
if (!request._source) {
// Special requests like indexes that just need to run some code,
// with error handling already built into operation
await operation();
} else {
+ await waitMacroQueue();
+
let event;
try {
BridgeIDBFactory.enableTracing &&
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.