From 1206eed391f03f71c35e973bde92bdfc9af468a1 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 12 Jan 2023 16:19:56 +0000 Subject: [PATCH] Fix failure to start in firefox private browser --- src/client.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index c7c75b35dbb..91cc21be0b0 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1690,12 +1690,16 @@ export class MatrixClient extends TypedEventEmitter { - logger.error(`Failed to remove IndexedDB instance ${dbname}: ${e}`); - reject(new Error(`Error clearing storage: ${e}`)); + // In private browsing, Firefox has a global.indexedDB, but attempts to delete an indexeddb + // (even a non-existent one) fail with "DOMException: A mutation operation was attempted on a + // database that did not allow mutations." + // + // it seems like the only thing we can really do is ignore the error. + logger.warn(`Failed to remove IndexedDB instance ${dbname}:`, e); + resolve(0); }; req.onblocked = (e): void => { logger.info(`cannot yet remove IndexedDB instance ${dbname}`); - //reject(new Error(`Error clearing storage: ${e}`)); }; }); await prom;