Skip to content
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

[0.57] - NetInfo methods fail to resolve or reject #21953

Closed
3 tasks done
GregoryCollett opened this issue Oct 25, 2018 · 7 comments
Closed
3 tasks done

[0.57] - NetInfo methods fail to resolve or reject #21953

GregoryCollett opened this issue Oct 25, 2018 · 7 comments
Labels
Bug 🌐Networking Related to a networking API. Resolution: Locked This issue was locked by the bot.

Comments

@GregoryCollett
Copy link

GregoryCollett commented Oct 25, 2018

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 1.94 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.0.0 - /usr/local/bin/node
Yarn: 1.9.2 - ~/.yarn/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0 => 16.6.0
react-native: 0.57.3 => 0.57.3

Description

NetInfo.getConnectionInfo() & NetInfo.isConnected.fetch() fail to resolve or reject

Reproducible Demo

Able to reproduce this in the simplest of scenarios running on an iOS simulator in debug js mode (android untested)
NetInfo.getConnectionInfo().then(console.log).catch(console.log) <- neither log occurs

@react-native-bot react-native-bot added 🌐Networking Related to a networking API. 🔶APIs labels Oct 26, 2018
@JumalDB
Copy link

JumalDB commented Oct 26, 2018

We have similar issue
#21862

@GregoryCollett
Copy link
Author

GregoryCollett commented Oct 26, 2018

Seem's this is working in 0.57.4 patch.

Edit: seems I was wrong... worked a few times but not consistently. Continues to fail in 0.57.5

@AbigailMcP
Copy link

I'm experiencing the same issue in 0.57.7 -NetInfo.isConnected.fetch() only very occasionally resolves.

I've just had to downgrade to 0.56 to fix.

@benjarwar
Copy link

Experiencing similar issues with NetInfo.isConnected.addEventListener in 0.57.8.

@juanfer0002
Copy link

Just to add. This is a problem that only occurs in iOS, it's working fine in Android.

A snippet like this would never print 'After isConnected':

static async checkConnection() {
    console.log('Before isConnected');
    let isConnected = await NetInfo.isConnected.fetch();
    console.log('After isConnected', isConnected);
}

@cpojer
Copy link
Contributor

cpojer commented Feb 12, 2019

Heads up: we moved react-native-netinfo into its own repository, which should allow for making changes and fixes much faster. Please continue the discussion about this issue there: react-native-netinfo/react-native-netinfo#9

@cpojer cpojer closed this as completed Feb 12, 2019
@matt-oakes
Copy link
Contributor

Just a note to say that it looks like the cause of this issue is the same as #21862, which is now being tracked at react-native-netinfo/react-native-netinfo#10.

Please let me know if they are not the same root cause by opening an issue with an updated reproducible demo on the new community repo.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 12, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug 🌐Networking Related to a networking API. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants