firebase / firebase/firebase-js-sdk

Connection Lost on Safari

Open
#7,132 26 comments 5 reactions 1 assignee Claimed by @maneesht View on GitHub
api: database bug stack:React v9
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [REQUIRED] Describe your environment

* Operating System version: iOS 16+
* Browser version: Safari 16+
* Firebase SDK version: 9.9.2
* Firebase Product: realtime database

### [REQUIRED] Describe the problem

#### Steps to reproduce:

1. Use the javascript sdk in a react app in PWA mode in an iphone with iOS 16+.
2. Use the onValue method to observe for changes on one component.
3. Open the component that uses onValue.
4. Close the component.
5. Put the app in background.
6. Interact with other apps on the phone for a few minutes.
7. Open the component again that uses the onValue method.

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](https://firebase.google.com/docs/database/web/offline-capabilities).

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:
![image](https://user-images.githubusercontent.com/51852105/225910427-3ffc8fe3-c445-4345-9179-0d4bebb9f363.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.