React-native-firebase: 馃敟Possible unhandled promise rejection

Created on 18 Mar 2019  路  3Comments  路  Source: invertase/react-native-firebase

Issue

I have a listener on a collection like this:
this.unsubscribe = firebase .firestore() .collection(path/to/collection) .where('field', '==', value) .orderBy('field') .onSnapshot(this.snapshotHandler, this.errorHandler);

When the device is offline snapshotHandler and errorHandler are not called, but i get this warning:
Possible Unhandled Promise Rejection (id: 0):
Error: Firestore: The service is currently unavailable. (firestore/unavailable).

How can i catch this type of errors? (offline device or similar)

Environment

  • Platform that you're experiencing the issue on:

    • [ ] iOS

    • [ ] Android

    • [ ] iOS but have not tested behavior on Android

    • [ ] Android but have not tested behavior on iOS

    • [ x] Both

  • If known, the version of the platform are you experiencing the issue on:

    • Android 7.0 and iOS 12.1.4

  • Operating System:

    • [ x] MacOS, version: 10.14.3

    • [ ] Windows, version: N/A

    • [ ] Other, please specify: N/A

  • Build Tools:

    • Xcode 10.1, Android Studio 3.3

  • React Native version:

    • 0.58.6

  • React Native Firebase library version:

    • 5.2.3

  • Firebase module(s) you're using that has the issue:

    • [] N/A

    • [x ] Authentication

    • [ ] Analytics

    • [ x] Cloud Firestore

    • [x ] Cloud Messaging (FCM)

    • [ ] Crashlytics

    • [ ] Dynamic Links

    • [ ] Functions Callable

    • [ x] In App Messaging

    • [ ] Indexing

    • [ ] Invites

    • [ ] Instance ID

    • [ ] ML Kit

    • [x ] Notifications

    • [ ] Performance Monitoring

    • [x ] Realtime Database

    • [ ] Remote Config

    • [ ] Storage

  • Are you using TypeScript?

    • [ x] No

    • [ ] Yes, version: N/A

  • Are you using Expo, e.g. ExpoKit?

    • [x] No

    • [ ] Yes, I've _not_ ejected

    • [ ] Yes, but I have ejected to ExpoKit

    • [ ] Yes, but I have ejected to vanilla React Native

Firestore Stale

All 3 comments

Do you think that puting your code in a try catch block could solve the problem ?
this.errorHandler is only for listen error on the snapshot method.

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adirzoari picture adirzoari  路  50Comments

bitfabrikken picture bitfabrikken  路  52Comments

abdullahizzuddiin picture abdullahizzuddiin  路  80Comments

OleksandrKucherenko picture OleksandrKucherenko  路  46Comments

matthieunelmes picture matthieunelmes  路  66Comments