-
Notifications
You must be signed in to change notification settings - Fork 893
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
"the client is offline." but it's not the case #6036
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Although I am not sure what exactly it is, using Firestore JS SDK in React Native has always met with connection issues like this. While I will try to troubleshoot this, I think you might be better off to try https://github.com/invertase/react-native-firebase instead. |
The advantage of v9 modular is the final size of the project is majorly reduced, if i use rn-firebase would i take advantage of the v9 like with the real firebase or not ? |
https://github.com/invertase/react-native-firebase uses the Android or iOS SDK under the hood and not the Web SDK. There is currently no tree-shaking. |
Can you invoke This is what I am seeing:
|
I got the same issue but only on android. iOS is working just fine. |
this is the log i got by Importing
i didn't hide anything because this is a test project just for this issue so here is the logs |
And i would like to test on IOS, i have an Iphone but not a macbook so i can't currently test running on IOS |
The log looks (I am a bit surprised there is no initiating of a backoff attempt though). I am unfortunately not able to reproduce this on iOS at the moment, but should be in a couple of days. In the meantime, if you have some spare cycles it would be interesting to see if you can use "firebase/firestore/lite" which uses plain HTTP for its networking. It does not support offline usage and onSnapshot listeners though. |
I've started seeing this error on an app deployed in production that hasn't seen any changes in a while. Firebase SDK version: 9.6.5 and 9.6.8 as well. Multiple browsers. Could it be something with AppCheck? The only change I see in the console is that starting today AppCheck is reporting client requests for Firestore in our project. Enforcing is not enabled though. |
Also have seen this since this morning ~11AM ET. We are on It also intermittently happens, some devs are able to reproduce while others aren't. |
In our case a third-party script (FullStory session recording) was interfering with Firestore requests. I don't know how it is intercepting XHR requests and what changed today in their script, but once we disabled it the Firestore issue went away. Sorry folks for polluting this issue, but maybe this will offer some clues on what might be the cause here. |
Last line is the value stored in Firestore so it's worked maybe the issue come from a Firewall or i don't know i have no antivirus and disabled windows Defender so it's maybe coming from Android studio / Metro ? i try to see because I'll need to use onSnapshot listeners Edit : Or maybe i can force request of the 'firebase/firestore" to be HTTP i currently don't find a way, every google searches redirect me to Firebase functions i continue searching. |
Also seeing this with React Native on Android 12. |
Seeing this intermittently on Linux too, in Electron. Edit: @schmidt-sebastian did you mean to assign this to @sampajano or yourself? |
Hi :) Could you try to enable the Code:
|
Hi, it worked perfectly, and used it like this : const db = initializeFirestore(app, {
experimentalAutoDetectLongPolling: true
}) because i'm in v9 Thank you so much it is even faster than before ! :) |
Fantastic! Glad it worked and thanks for sharing the results! 😃 |
What about Realtime Database? and @sampajano what about cases where this error is caused by pausing the code for a few seconds in the debugger? (Edit: Actually it occurs in the debugger almost 100% of the time, even if there's no pausing, but only if a user is signed in, but probably because that's the only time we register listeners.) It says it's offline even milliseconds before our listeners fire off actions in response to, apparently, being online. Maybe I'm just being fooled by offline persistence though? @x-Wawa would you please re-open this issue? |
hello, i'm facing the same problem |
Hi all, fyi, since moving a big part of our existing codebase to modular firebase we've also started to experience this issue frequently. |
Hi, we've been having this issue for a while as well when connecting to Realtime Database, both in production and locally, and also in the emulator. We use Firestore as well but the issue doesn't seem to occur there. |
I am having this issue as well (using Realtime Database) |
People who are experiencing this; please do edit to specify whether you're using Realtime Database or Firestore, as both are being discussed in this issue. |
Hey, I also have been experiencing this issue, particularly while using Realtime Database, locally, in production as well as in the emulator. |
Hello, I'm getting this issue too and it's on Realtime Database. |
It seems like most people are experiencing this with RTDB except maybe @codescooper ? @codescooper Can you please confirm which DB you are using? |
This is increasingly disruptive for us - preventing us from doing development or testing. The issue is over 90 days old now. Could we get some comment from the Firebase team about what Realtime Database users are supposed to do to remedy this? I know Realtime Database isn't what Firebase is pushing these days, but we deserve a solution as much as Firestore users.
And so no work can be done at all. |
@maneesht this would be interested to look into. |
@slapbox could you enable logging for RTDB? import { enableLogging } from '@firebase/database';
enableLogging(true);
//initialize firebase And then can you paste the logs? But please be sure to leave out any project identifying information (URLs, projectIds, etc.) |
@maneesht the output looks like this (all logging is from Firebase logging except the line starting with Note that this same code worked fine before
|
Looks like an |
I'm very unlikely to be able to find time to make a repro case for this, but I can run this test again with the The logic flow is:
So literally all that's happening is that single |
Thank you for the information. I was able to reproduce this. I will be looking into it. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
I saw the #5836 and many others on Stack Overflow, i'm facing the same issue i recreated a few time test projects to try connect to Firestore but since i am using firebase v9 modular i can't access the database, same problem on my physical device (SM-A520F - 8.0.0) android 8 and on many emulators using android studio (Pixel, Pixel 2, Pixel 3, Pixel 4) different android version from 8 to 10.
the error is always the same :
ERROR [2022-02-27T23:03:53.595Z] @firebase/firestore: Firestore (9.6.7): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
LOG [FirebaseError: Failed to get document because the client is offline.]
Steps to reproduce:
Create react app using
npx react-native init AppName
Install firebase :
npm i firebase
Go in App.js and try this :
Relevant Code:
when i press the Text i wait 10-12s and the console return me the error above, the exact same error on all my support, i have did all my test with the same PC, i will try on another asap.
I am stuck with this from a long time now and i don't understand the problem, i have a excellent connection (more than 100mb/s) when i do speedtest on my device or my emulators.
The text was updated successfully, but these errors were encountered: