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

useIsConnected not updating on Hermes enabled iOS non-debug build #363

Open
robinclaes opened this issue Aug 22, 2022 · 3 comments
Open
Labels

Comments

@robinclaes
Copy link

robinclaes commented Aug 22, 2022

Current Behavior

  • I encountered an issue with react-native-offline where the result of useIsConnected stayed null while using Hermes on iOS. This happened on every startup with exception of the first, and only with non-debug builds.
  • I've tried updating @react-native-community/netinfo but the problem seems unrelated to that package version.

Expected Behavior

  • The result of the useIsConnected hook changes from null to true or false

How to reproduce

  • Run a react native app with the latest react-native-offline version and react native version 0.67.4
  • Enable hermes on iOS
  • Load the hook on the first screen
  • It is initially null, but never changes to true or false
  • Run the app bundled (not in debug mode)

A strange thing I've noticed it can be resolved by setting pingInBackground to true - but this is not our desired behaviour.
We're simply disabling hermes for now.

Reproducible example in the first comment below.

Your Environment

software version
react-native-offline 6.0.0
react-native 0.67.4
node 16.15.1
npm or yarn yarn 1.22.19
@robinclaes
Copy link
Author

robinclaes commented Aug 22, 2022

I have added a minimal reproducible example here:
https://github.com/robinclaes/react-native-offline-hermes-bug

Please remember

  • Build in Release mode (you need a Apple development team)
  • The issue does not occur on the first startup, it happens on every consecutive startup

@SMKH-PRO
Copy link

SMKH-PRO commented Oct 6, 2022

This is also happening on my end, regardless of build type.

I am facing this on both release build and debug build, if you delete the app data and launch the app first time on iOS isConnected is null, if you close and re-open the app it works completely fine.

I guess this library is dependent on netinfo which is the actual cause of this problem: react-native-netinfo/react-native-netinfo#572

@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants