firebase / firebase/firebase-js-sdk
Network request to https://apis.google.com/js/api.js times out on iOS when on IPV6 address with “limit IP address tracking” enabled
- 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 15.2+
* Browser version: Safari 15.2+
* Firebase SDK version: 9.8.3
* Firebase Product: Auth
--------------------------------------------------------
* Having an IPV6 address
* "limit IP address tracking" enabled
* (?) using an account subscribed to iCloud+
### [REQUIRED] Describe the problem
Possibly related to #7012
IOS seems to proxy traffic for "tracking domains" to get around IP tracking, I believe apis.google.com is on their list. This causes the network request to be routed through their internal VPN service which potentially doesn't work well with IPV6.
*Apple potentially uses a second (more aggressive) VPN service for their customers subscribed to iCloud+, we believe this to be pertinent to the issue but aren't sure.
This network request is only made either during proactive initialisation or logging in with a popup, such as OAuth through google or Facebook, and it causes our project to hang or fail because we're forced to wait for the network request to complete.
Disabling proactive initialising solves this issue, and we have a workaround, but would prefer a more official way to accomplish this.
#### Steps to reproduce:
1. Enable "limit IP address tracking" on an iPhone (possibly enabled by default)
2. Be on a ISP that provides an IPV6 address
3. Load firebase auth through a webpage
4. Request to "https://apis.google.com/js/api.js" hangs on TCP for ~20-40 seconds before timing out
#### Workaround
Disable `BrowserPopupRedirectResolver:_shouldInitProactively`
`sed -i.bak 's/return _isMobileBrowser() || _isSafari() || _isIOS();/return false\/*Force disabling due to ios tracking bug*\/;/g' node_modules/@firebase/auth/dist/esm2017/index-*.js`
Preferably, there should be a call to disable proactively initialising, such as
```
BrowserPopupRedirectResolver:_shouldInitProactively
if(proactivelyOptOut) return false;
setProactivelyOptOut(true);
```
Contributor guide
Assessment
This issue has not been assessed yet.