-
Notifications
You must be signed in to change notification settings - Fork 892
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
Connection Lost on Safari #7132
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Any update here? |
Any update here? |
Could you provide a minimal reproducible test case so that we can better understand and reproduce your code usage? Thanks! |
Hi @DellaBitta,
|
Thanks for clarifying the steps. I'm also seeking the code snippet of when you register the Database listener. There are some nuances there particularly when it comes to React components. For instance, you might use the onEffect function (as described here) or perhaps not? I don't think we'd need your whole app, but could you please post the code that demonstrates how you've set up the listener in your component? Also, to clarify:
Which method? The callback registered with onValue? Is it invoked but it's not returning, or is it not being invoked at all? Finally, have you successfully tested this on other browsers, and if so which ones? Thank you! |
Hi @DellaBitta, We use a service to initialize firebase. An instance of the service is exported in the same file. Here is the code:
This service is used through a hook. Code for that is:
This hooks is then used in a component in this form:
Also, we were recently experimenting with the
With respect to your question, I have mentioned the Other browsersWe have tested on Google Chrome and Samsung Internet and found that the issue does not exist over there. |
Any update here, @DellaBitta ? |
I have the same issue on Vue 2.7, firebase-js sdk 9.22.2, cordova, iOS 16+ |
Any update here, @DellaBitta? |
I'm seeing this as well. For me I can see the issue straight away when I switch off my wifi and start using cellular data on my iPhone. I have a standard setup for connecting to the database (not within a service worker) and listening to onValue(). Also, the issue has nothing to do with React as it occurs without it. |
After doing a bit more digging I found this WebKit bug which explains the behaviour I'm seeing https://bugs.webkit.org/show_bug.cgi?id=247943. If you turn off the NSURLSession WebSocket experimental WebKit feature does this bug go away? |
Any update here @DellaBitta? |
Hi everyone, thanks for the detailed steps on replicating the behavior and some additional information about the issue. I was able to replicate it and raised it to our Firebase Realtime Database team. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share. |
Any update here guys? |
we have somewhat similar issues in AngularFire, even if I use the firebase library the value is not received true/false for a connection status on iOS but meanwhile every other OS and browser seems to work fine. |
Any update here @DellaBitta, @jbalidiong ? |
Any update here @DellaBitta , @jbalidiong ? |
Someone from the RTDB team is looking into this issue. |
Hi @maneesht, We are working on another similar feature but have planned to use Firestore instead. Is there any chance that such an issue might exist there as well? |
Hi @ahmed-shahid-confiz - I don't believe the same issue should occur using Firestore, as they don't use websockets, and instead use webchannel. Tagging @dconeybe from the Firestore team to add any additional clarifications. Also, I'm not sure how relevant the listed webkit bug is to the issue above, as it seems more related to losing connectivity. Do you have any connectivity issues when running the steps you mentioned above? |
Hi @maneesht, I dont think the issue is related to connectivity because we have tried calling cloud functions via the sdk while this issue had occurred in the app. The cloud functions work as desired. Is there anything else I need to check in this respect? |
I have not heard of issues of this nature on Firestore. I can definitely confirm that Firestore does not use websockets, but rather uses webchannel, a Google-authored alternative to websockets (link). @lazmeister Have you reported your bug to Firestore? If so, please provide the issue link. If not, feel free to open a new issue if this is still a problem for you. If you do have an issue, it is very unlikely to be related to this Realtime Database issue since the code bases for Firestore and Realtime Database are completely separate. |
@dconeybe When I have some time I will create a repo to show the issue. We are definitely having issues with offline/online detection period on iOS but we are also using AngularFire so that's a whole other problem since they are not on the latest firebase |
@lazmeister I'm facing similar issue on Firestore after migrate version 8 to 10. Just on OS: iOS 16 or Safari 16. iOS 17 works fine. |
I'm facing this I think - iOS16 with latest React and Firebase sdk. When it happens for me it affects all tabs. Refreshing the tab does not solve it and new tabs face the problem as well with onValue never firing success or failure. When it starts working in one tab it then works in all tabs. I believe I was able to have it operate correctly in incognito tabs while the issue reproduced in normal tabs which was interesting. I was able to trigger this issue while using my phone around the city but never in a controlled environment. Is the workaround here to move to firestore? Is there another issue tracking this? |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
The onValue method never returns the snapshot and does not throw any error either.
I have tried managing online presence as mentioned in the documentation here.
The onValue method does not return for the ".info/connected" node nor does it throw any error.
It starts working once the app is killed and relaunched. But, we cannot communicate to users to kill the app whenever they see an issue such as this. Can anybody help here?
I reached out to support and this was their final response which is why I opened the issue here on GitHub:
The text was updated successfully, but these errors were encountered: