Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failure to start in firefox private browser #3058

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1690,12 +1690,16 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
resolve(0);
};
req.onerror = (e): void => {
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;
Expand Down