-
Notifications
You must be signed in to change notification settings - Fork 948
Provide better error message for failed shutdown #3164
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
Conversation
Binary Size ReportAffected SDKs
Test Logs
|
} catch (e) { | ||
throw new FirestoreError( | ||
Code.UNAVAILABLE, | ||
'Firestore shutdown failed. The client is in an undefined state: ' + e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Firestore instance fails to terminate, what's the user's recourse? Should they retry? Could they retry? Other entry points like listen
are retryable and it seems like this aspect should be consistent. At the very least, the error message here or our comments should indicate what the user should do.
Note that users may be calling terminate
directly and may not be deleting the Firebase App. I agree we can't solve the app deletion case without considerable effort, but it seems like solving the standalone terminate
case is something we could handle.
I'm not sure it helps, but in the iOS port this has been reworked slightly so that the async queue is flagged as shut down first and then the termination action is enqueued (I haven't ported this yet because of higher priority work). In the arrangement the block that shuts everything down can run repeatedly. It seems like this change would make terminate retryable, no?
💥 No ChangesetLatest commit: b77597f Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
05d9b10
to
6e8e2b4
Compare
6e8e2b4
to
b77597f
Compare
This changes the error message for
terminate()
to state that the client is now in an undefined state.We could probably make shutdown idempotent for IndexedDB failures, but it might be quite an engineering feet that spans more than just Firestore (since we also need to delete the FirebaseApp). I am not opposed to doing this, but would like to propose this simple "solution" for now.
Addresses #2755