inProgress-team / react-native-meteor

Meteor Reactivity for your React Native application :)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When app is put in background and network is disconnected, white screen is displayed without any error

lc3t35 opened this issue · comments

Steps to reproduce :

  1. put your app in background
  2. open network prefs and disable all networks (as if you were in a tunnel without wifi or phone data network 3G/4G)
  3. call your app back -> a white screen is displayed

The main problem is how to debug that as when your disconnect your network, you don't have any more console log information (i'm using expo) nor debugger.
I'm trying to :

  • debug within XCode with USB plug, but as there is no error in libraries, unsuccessful for now
  • setup a github with meteor testbed and snack.expo.io project to reproduce the problem without my full app

If someone has an idea, we can discuss in the gitter Lobby.

Here the snack so you can see the expected behaviour : https://snack.expo.io/@lc3t35/react-native-meteor-issue-323
0 - launch app with expo
1 - put your app in background
2 - open network prefs and disable all networks (as if you were in a tunnel without wifi or phone data network 3G/4G)
3 - call your app back, information is updated on screen, no white screen

Rebuilding RNApp example and setup environment to reproduce the issue

  • migrate from createContainer to withTracker
  • upgrade to RN 0.55.2 -> #324
  • merge snack code with RNApp example

Have there been any insights to this problem?

I have the exact same issue, but not using expo. Definitely seems to be related to connectivity.

  • RN 0.55.4
  • react-native-meteor 1.3.0
  • redux 4.0.0
  • react-native-meteor-redux 2.2.5

Standard template using rn+meteor+redux+offline

const MyComponentContainer = withTracker(params => {
    GroundedMeteor.subscribe('subsId', 'myCollection');
    return {
        myCollection: GroundedMeteor.collection('myCollection', 'subsId').find({}),
    };
})(MyComponent);

function mapStateToProps(state) {
    return {
        user: state.meteorReducer.user,
    };
}

export default connect(mapStateToProps)(MyComponentContainer);

@edwin-n-johnson As my app is detached, I confirm it also happens outside expo, I've just use expo here to quickly reproduce the problem.

Thanks @lc3t35. Have you made any progress finding the root cause? I'm curious as to why we are seeing it and not many others. And why are there no errors?

I think this may occur because rn-meteor relies on NetInfo API and NetInfo had some issue before becoming a standalone library.

commented

Hey there , do we have any update on this , i am also facing the same issue