Skip to content

Commit

Permalink
When subscribing for network connectivity broadcasts, also query the …
Browse files Browse the repository at this point in the history
…value so we always have the most up-to-date value.

Summary:
We've seen cases (based on logs) where NetInfo is reporting no connectivity, but network requests still work. This will keep status up to date after app foreground <-> backgrounds, since we don't listen to broadcasts when backgrounded.

This is rather difficult to test given we haven't nailed an internal repro (evidence is solely based on device/app logs).  Testing has been done to ensure that there are no behavioural changes on devices that were previously working (no regressions).
Closes #15558

Differential Revision: D6264708

Pulled By: hramos

fbshipit-source-id: 1648cadb59949103d0a595614b38024ec9236719
  • Loading branch information
berickson1 authored and facebook-github-bot committed Nov 7, 2017
1 parent cb6ec7c commit e6f542d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private void registerReceiver() {
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
getReactApplicationContext().registerReceiver(mConnectivityBroadcastReceiver, filter);
mConnectivityBroadcastReceiver.setRegistered(true);
updateAndSendConnectionType();
}

private void unregisterReceiver() {
Expand Down

1 comment on commit e6f542d

@AndrewIngram
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be related to this? #15729

Please sign in to comment.