New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [firebase_database] Client is offline #8220
Comments
Keep on seeing the same error on the first run 👆 |
When a write request is triggered, it writes to local db first and then if sync with server is successful, the request will be carried out. Since you are using |
Thanks for the explanations. I am already using the persistence, i have called I have fall back on the |
@Tom3652 |
I have got an answer from Firebase support :
|
I have the same issue with .get() but only I do heavy UI, eg: shimmer loading items, this depends on the device power tho. |
Hi @darshankawar, do you expect something else from me for this issue ? I guess that if the client is offline at the moment of the query, there should be a way to ensure that the database is online first (and not I am more about turning it into a feature request than a bug request then, that would be to handle this case internally. |
Sorry for coming back a bit late on this.
Check this SO answer from a former firebase member. Although that is for firestore, but I am sure the same would be applicable for database plugin too. See if that comment helps a bit further. |
Alright thanks for the update i understand, i will be using .once() for now because there doesn't seem to be any retry on the The .once() however seems to be retrying from the server if there is no internet connectivity for example, until there is a concrete response (unless it finds from the cache first apparently, but i don't cache anything to avoid this). |
I'll label it for team's insights on this though to know what would be the possible root-cause for this. /cc @russellwheatley |
I'm also suffering due to the same issue. I'm sure that there is an internet connection up but got "Client is offline" message. |
firebaser here This is actually a known issue in our native SDKs for Android, iOS and Web, which give up too soon when getting the value from the server on startup. We have a fix going out for this in version 20.0.5 of the Android SDK for the Realtime Database. Once that lands and is picked up in FlutterFire too, the problem should disappear. |
Bug report
Describe the bug
I am having this error :
20% of the time. When i was using
.once()
i have never had this issue.The client is indeed online because all my other queries work fine.
Also, I have thought that maybe
firebase_database
take time to initialize itself or something, i have calledawait FirebaseDatabase.instance.goOnline()
before but this doesn't help :/The problem with
.once()
is that it returns sometimes a value that doesn't match the one in DB i don't know why, so i would rather be using.get()
to :It's also written
falling back to disk cache after error
. What does it mean please ? Doesfirebase_database
try to read data from local cache ? I thought it was only writing to disk cache to retry failed writes later.Steps to reproduce
I don't know how to reproduce it, but i have it more often in my test project when i query right after app start.
If i add a 3-5 sec delay it works better.
In my real app the delay is already more or less 3 seconds.
Expected behavior
The query should not throw Client is offline when client is online.
In case the
Client is offline
from a DB perspective, please provide another error to understand what is the real error (database failed to established a connection for example).Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: