Skip to content

Commit 4480679

Browse files
committed
networking: Fully fix requests failing when turning network off and on facebook#19709.
The previous commit partially fixed facebook#19709 by evicting all idle connections on DISCONNECT and CONNECTING events. To fully fix facebook#19709, also cancel all ongoing calls on these events. Cancel the ongoing calls before evicting all idle connections, because cancelling the ongoing calls can result in more idle connections.
1 parent aa2e00a commit 4480679

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public void onReceive(Context context, Intent intent) {
8585
final Thread thread = new Thread() {
8686
public void run() {
8787
for (OkHttpClient client: sClients) {
88+
client.dispatcher().cancelAll();
8889
client.connectionPool().evictAll();
8990
}
9091
result.finish();

0 commit comments

Comments
 (0)