From 85860cae08bb93ea92e3d5ef942ce05a885381f7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2023 16:08:01 +0100 Subject: [PATCH] Destroy idb worker when stopping client (#10899) * Destroy idb worker when stopping client * Iterate * Iterate * Iterate --- src/Lifecycle.ts | 1 + src/MatrixClientPeg.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 763cfa1e87..417309eb64 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -940,6 +940,7 @@ export function stopMatrixClient(unsetClient = true): void { if (unsetClient) { MatrixClientPeg.unset(); EventIndexPeg.unset(); + cli.store.destroy(); } } } diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index 52d91dc9d1..c318f5e4d0 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -194,6 +194,7 @@ class MatrixClientPegClass implements IMatrixClientPeg { private onUnexpectedStoreClose = async (): Promise => { if (!this.matrixClient) return; this.matrixClient.stopClient(); // stop the client as the database has failed + this.matrixClient.store.destroy(); if (!this.matrixClient.isGuest()) { // If the user is not a guest then prompt them to reload rather than doing it for them