Skip to content

Commit ceabb8f

Browse files
authored
Merge 8524375 into 1b33fda
2 parents 1b33fda + 8524375 commit ceabb8f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.changeset/brown-dog-twirl.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/firestore": patch
3+
---
4+
5+
Improved the error handling when opening IndexedDb fails in a Firefox private browsing session.

packages/firestore/src/local/simple_db.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,17 @@ 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 could be due to running in a ' +
330+
'private browsing session on a browser whose private browsing sessions do not ' +
331+
'support IndexedDb. (' +
332+
error +
333+
')'
334+
)
335+
);
325336
} else {
326337
reject(new IndexedDbTransactionError(action, error));
327338
}

0 commit comments

Comments
 (0)