Skip to content

Commit aa1e118

Browse files
authored
Fix failure to start in firefox private browser (#3058)
1 parent d23c3cb commit aa1e118

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/client.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,12 +1690,16 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
16901690
resolve(0);
16911691
};
16921692
req.onerror = (e): void => {
1693-
logger.error(`Failed to remove IndexedDB instance ${dbname}: ${e}`);
1694-
reject(new Error(`Error clearing storage: ${e}`));
1693+
// In private browsing, Firefox has a global.indexedDB, but attempts to delete an indexeddb
1694+
// (even a non-existent one) fail with "DOMException: A mutation operation was attempted on a
1695+
// database that did not allow mutations."
1696+
//
1697+
// it seems like the only thing we can really do is ignore the error.
1698+
logger.warn(`Failed to remove IndexedDB instance ${dbname}:`, e);
1699+
resolve(0);
16951700
};
16961701
req.onblocked = (e): void => {
16971702
logger.info(`cannot yet remove IndexedDB instance ${dbname}`);
1698-
//reject(new Error(`Error clearing storage: ${e}`));
16991703
};
17001704
});
17011705
await prom;

0 commit comments

Comments
 (0)