Skip to content

Commit 0a5c7c4

Browse files
committed
Fail more gracefully when opening IndexedDb databases fail in Firefox private browsing
1 parent d0d3acb commit 0a5c7c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/firestore/src/local/simple_db.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,16 @@ export class SimpleDb {
322322
'data for your app to start fresh.'
323323
)
324324
);
325+
} else if (error.name === 'InvalidStateError') {
326+
reject(
327+
new FirestoreError(
328+
Code.FAILED_PRECONDITION,
329+
'Unable to open an IndexedDb connection; this may be due to running in a ' +
330+
'Firefox private browsing session, in which IndexedDb is not supported ' +
331+
'(https://goo.gle/3ymSNyf): ' +
332+
error
333+
)
334+
);
325335
} else {
326336
reject(new IndexedDbTransactionError(action, error));
327337
}

0 commit comments

Comments
 (0)