Skip to content

Retry all non-Firestore exceptions - #2288

Merged
schmidt-sebastian merged 3 commits into
masterfrom
mrschmidt/retries
Oct 22, 2019
Merged

Retry all non-Firestore exceptions#2288
schmidt-sebastian merged 3 commits into
masterfrom
mrschmidt/retries

Conversation

@schmidt-sebastian

Copy link
Copy Markdown
Contributor

Our users are still seeing IndexedDB errors on iOS 13 (using IONIC/Cordova). One of the possible reasons is that some environments might not throw DOMExceptions, which would lead us to not retry. This PR flips our logic around and only skips retries if the underlying exception is a non-Firestore exception.

Fixes #2232

Our users are still seeing IndexedDB errors on iOS 13 (using IONIC/Cordova). One of the possible reasons is that some environments might not throw DOMExceptions, which would lead us to not retry. This PR flips our logic around and only skips retries if the underlying exception is a non-Firestore exception.

Fixes #2232
const retryable =
idempotent &&
isDomException(e) &&
error.name !== 'FirebaseError' &&

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.

Note that the instanceof check doesn't work here since the Async/Await wraps our FirestoreError in a generic Error.

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.

This might be worthwhile to add as an actual comment to the code rather than just the PR.

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

@wilhuff wilhuff left a comment

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.

LGTM

@wilhuff wilhuff assigned schmidt-sebastian and unassigned wilhuff Oct 21, 2019
@schmidt-sebastian
schmidt-sebastian merged commit 3264492 into master Oct 22, 2019
@Feiyang1 Feiyang1 added this to the 7.2.2 milestone Oct 29, 2019
@firebase firebase locked and limited conversation to collaborators Nov 21, 2019
@schmidt-sebastian
schmidt-sebastian deleted the mrschmidt/retries branch February 28, 2020 23:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

3 participants