Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Cloud Firestore throws "client is offline"

About 3 out of 4 times loading the page I get this error from the firestore client SDK (web). This slows development down tremendously. Auth, Realtime DB and Storage work perfectly fine.

Failed to get document because the client is offline. 

Error

Is there something I can do about this?

like image 970
ProblemsOfSumit Avatar asked Oct 06 '17 09:10

ProblemsOfSumit


People also ask

How does firestore work offline?

When the device comes back online, Firestore synchronizes any local changes made by your app to the Firestore backend. Note: Offline persistence is supported only in Android, Apple, and web apps. To use offline persistence, you don't need to make any changes to the code that you use to access Firestore data.

Does firebase Auth work offline?

By enabling persistence, any data that the Firebase Realtime Database client would sync while online persists to disk and is available offline, even when the user or operating system restarts the app. This means your app works as it would online by using the local data stored in the cache.

Is firestore offline first?

Cloud Firestore supports offline data persistence. This feature caches a copy of the Cloud Firestore data that your app is actively using, so your app can access the data when the device is offline. You can write, read, listen to, and query the cached data.

Does firebase have DDoS protection?

Security & Protection While Firebase does have a CDN, it doesn't offer you distributed denial of service attacks (DDoS) prevention, web application firewall (WAF), or rate-limiting. All of these are incredibly important to prevent malicious actors from breaking your system or stealing your data.


2 Answers

There's currently an interaction between the clients and routing on the backend that results in this problem. As a result the client believes the network is failing and goes offline.

We'll be rolling out a fix for this soon. Exact times I can't promise but this is among our top priority issues to fix.

Thanks for your patience.

like image 72
Gil Gilbert Avatar answered Oct 04 '22 16:10

Gil Gilbert


I updated all my packages and I ran into this issue.
I enabled offline persistence for my web app and that fixed the problem:

firebase.firestore().enablePersistence() 

https://firebase.google.com/docs/firestore/manage-data/enable-offline

like image 24
Sam Vedernikoff Avatar answered Oct 04 '22 14:10

Sam Vedernikoff