idb-bridge: avoid unhandled rejection when closing DB
This commit is contained in:
parent
e84a1789af
commit
f4d66541ed
@ -562,10 +562,12 @@ export class MemoryBackend implements Backend {
|
|||||||
throw Error("connection not found - already closed?");
|
throw Error("connection not found - already closed?");
|
||||||
}
|
}
|
||||||
const myDb = this.databases[myConn.dbName];
|
const myDb = this.databases[myConn.dbName];
|
||||||
// FIXME: what if we're still in a transaction?
|
if (myDb) {
|
||||||
myDb.connectionCookies = myDb.connectionCookies.filter(
|
// FIXME: what if we're still in a transaction?
|
||||||
(x) => x != conn.connectionCookie,
|
myDb.connectionCookies = myDb.connectionCookies.filter(
|
||||||
);
|
(x) => x != conn.connectionCookie,
|
||||||
|
);
|
||||||
|
}
|
||||||
delete this.connections[conn.connectionCookie];
|
delete this.connections[conn.connectionCookie];
|
||||||
this.disconnectCond.trigger();
|
this.disconnectCond.trigger();
|
||||||
}
|
}
|
||||||
|
@ -2655,13 +2655,13 @@ export class BridgeIDBTransaction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await waitMacroQueue();
|
|
||||||
|
|
||||||
if (!request._source) {
|
if (!request._source) {
|
||||||
// Special requests like indexes that just need to run some code,
|
// Special requests like indexes that just need to run some code,
|
||||||
// with error handling already built into operation
|
// with error handling already built into operation
|
||||||
await operation();
|
await operation();
|
||||||
} else {
|
} else {
|
||||||
|
await waitMacroQueue();
|
||||||
|
|
||||||
let event;
|
let event;
|
||||||
try {
|
try {
|
||||||
BridgeIDBFactory.enableTracing &&
|
BridgeIDBFactory.enableTracing &&
|
||||||
|
Loading…
Reference in New Issue
Block a user