inProgress-team / react-native-meteor

Meteor Reactivity for your React Native application :)
MIT License
693 stars 210 forks source link

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

Open lc3t35 opened 6 years ago

lc3t35 commented 6 years ago

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 :

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

lc3t35 commented 6 years ago

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

lc3t35 commented 6 years ago

Rebuilding RNApp example and setup environment to reproduce the issue

edwin-n-johnson commented 6 years ago

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.

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);
lc3t35 commented 6 years ago

@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.

edwin-n-johnson commented 6 years ago

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?

vforvasile commented 5 years ago

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

Akashdeep312 commented 3 years ago

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