Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions .changeset/brown-dog-twirl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Improved the error handling when opening IndexedDb fails in a Firefox private browsing session.
11 changes: 11 additions & 0 deletions packages/firestore/src/local/simple_db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,17 @@ export class SimpleDb {
'data for your app to start fresh.'
)
);
} else if (error.name === 'InvalidStateError') {
reject(
new FirestoreError(
Code.FAILED_PRECONDITION,
'Unable to open an IndexedDb connection. This could be due to running in a ' +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The official spelling seems to be IndexedDB.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

'private browsing session on a browser whose private browsing sessions do not ' +
'support IndexedDb. (' +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think you should move the period after the parenthesis or use : without parenthesis.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (changed to ":").

error +
')'
)
);
} else {
reject(new IndexedDbTransactionError(action, error));
}
Expand Down