firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
835 stars 433 forks source link

Firestore startup overloads logs (to crash) when Airplane mode is on #775

Closed jonahgoldsaito closed 4 years ago

jonahgoldsaito commented 4 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

When I turn on Airplane Mode on my iPhone 11, and try to launch my iOS app, it exits immediately. The same does not occur on Android, which is functioning as expected. I seem to be hitting an issue with Firestore connectivity.

2020-09-10 12:04:23.497713-0500 app[2760:677481] Task <844D54D1-564F-4973-A493-6AEBB57CA104>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283e0ce10 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <844D54D1-564F-4973-A493-6AEBB57CA104>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <844D54D1-564F-4973-A493-6AEBB57CA104>.<1>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=AIzaSyDZ9NJBOqY4Zxv3wDEG7wdV-uwZfxSmVPU, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=AIzaSyDZ9NJBOqY4Zxv3wDEG7wdV-uwZfxSmVPU, _kCFStreamErrorDomainKey=1}
libc++abi.dylib: terminating with uncaught exception of type firebase::firestore::util::FirestoreInternalError

This is the full log.

I have a system enabled called LunarConsole which allows me to display Debug logs/exceptions on mobile. This has been vital as I’m developing an ARFoundation app and Unity still hasn’t released a native AR Remote solution, making debugging challenging. As far as I know it essentially listens for logs. When LunarConsole is uninstalled, the bug does disappear. I found an old bug on the Flutter repo that mentions a potentially similar issue that occurs when “the firebase plugin just happens to log enough in airplane mode to trigger the crash.” Could Firestore be logging excessively and blowing up LunarConsole?

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Quickstart doesn’t utilize the same Unity/FB versions as our environment.

What's the issue repro rate? (eg 100%, 1/5 etc) 100%

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

  1. Install Firestore
  2. Install LunarConsole (asset store) (github)
  3. Turn on Airplane mode
  4. Launch the app on iOS.

If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.

Relevant Code:

The code is simply including / engage with Firestore while in Airplane Mode

DellaBitta commented 4 years ago

Hi @jonahgoldsaito,

Most of the warnings logged are from Firebase Auth in its inability to reach a particular service, but generally speaking there's nothing that sticks out as a critical error here. The first impression is that the logs don't seem to be too large, to be honest.

You might want to enable more logging to see if there's other Firestore issues taking place. You can do this via:

FirebaseFirestore.LogLevel = LogLevel.Debug;

With added logging volume it would be interesting to see if Lunar Console crashes at roughly the same amount of output or not.

google-oss-bot commented 4 years ago

Hey @jonahgoldsaito. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 4 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@jonahgoldsaito if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.