Hi Michael,
I'm facing the same problem and can add some detail. I've enabled Firestore logging to see the issue.
Let's say I turn all network connections off on my phone. Then, Firestore will throw this error:
Stream closed with status: zzfof{code=UNAVAILABLE, description=null, cause=java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
(full stack trace omitted)
This is followed by:
Backing off for 31774ms (base delay: 25624ms)
This is to be expected: Firestore is disconnected, so the underlying gRPC stream is UNAVAILABLE.
The problem is when I turn mobile data on again. Ever other network-reliant service starts working within ~3s. However, Firestore continues to throw the above error for ~1min (this varies) at a regular interval. During this time, if I try to run a Firestore transaction, I get the following error...:
com.google.firebase.firestore.FirebaseFirestoreException: Transaction failed all retries.
...with the same "UnknownHostException" stack trace as described above. I can trigger the transaction as many times as I like, but it will still fail with this error
even though all other network-reliant services are working just fine, and my device is connected to the internet.
Eventually (after ~1min), the logs will show:
[FirestoreCallCredentials]: Successfully fetched token.
After I see this in the logs, I can now successfully execute the Firestore transaction.
This is a really big problem, especially for users in developing markets. There, internet connections are spotty, and users toggle mobile data on/off regularly to conserve data. In these conditions, it is imperative that Firestore handle connectivity interruptions gracefully and speedily. Having to wait 1 whole minute to run a Firestore transaction is extremely disappointing, and forces me to switch to using Cloud Functions with HTTP Triggers as a stopgap solution.
Would be great to see if anyone else has found a solution to this... perhaps we can force Firestore to reconnect somehow?