-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
I'm not sure if this is a bug or not. If you'd rather I close this and discuss on Discord I can, but there are so many simultaneous discussions on Discord that sometimes it is hard to get answers.
Issue
All Firebase modules are working flawlessly when app is in the foreground, and for some time while in the background. After some time passes, we have trouble logging events and getting user auth tokens.
For example, we're having trouble with both of these:
Firebase.auth().currentUser.getIdToken(true).then((token) => {
doSomethingWithToken(token);
});
Firebase.analytics().logEvent('some_event', {
parameter1: 1,
parameter2: 'B'
});
After some period of time we can't seem to get any new tokens, so our app starts to send expired tokens with it's requests to Cloud Functions, resulting in 403 errors. When we can't get any new tokens, the analytics events also stop logging.
For example, we sent roughly 230,000 HTTP requests to Cloud Functions with auth tokens attached in the past 30 days. Roughly 55,000 of those failed from expired tokens. We log an analytic event on the client every time a request is sent, and we only received roughly 175,000 analytic events. Call me crazy but thats one hell of a coincidence.
Environment
- Application Target Platform: iOS (we target both but have not tested on Android)
- Development Operating System: macOS High Sierra
- Build Tools: Xcode 9.2, iOS 10.0 through 11.3
- React Native version: 0.54.4
- RNFirebase Version: 3.3.1
- Firebase Module: Only noticed on Authentication and Analytics but it likely isn't just those
Any ideas? Thanks.