Skip to content

Retry all non-Firestore exceptions #2288

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

Merged
merged 3 commits into from
Oct 22, 2019
Merged

Conversation

schmidt-sebastian
Copy link
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
// TODO(schmidt-sebastian): We could probably be smarter about this and
// not retry exceptions that are likely unrecoverable (such as quota
// exceeded errors).
const retryable =
idempotent &&
isDomException(e) &&
error.name !== 'FirebaseError' &&
Copy link
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
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
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@wilhuff wilhuff left a comment

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firestore: Attempt to get a record without an in-progress transaction
3 participants