From 995b66db8244a14fea4fedb88a2feaa1d3cf23e4 Mon Sep 17 00:00:00 2001 From: Lasse Bang Mikkelsen Date: Fri, 5 Feb 2016 15:07:31 -0800 Subject: [PATCH] Fix XMLHttpRequest.abort() not functional due to incorrect lazy loading in RCTNetworking ObjC module Summary: Introduced in a major lazy loading refactoring: 060664fd3d9331f062696e68179bac9cd4544a06. This is especially an issue when aborting a long-lived HTTP connection used as a notification channel, as it will use 1 of the maximum 4 connections per host (default limit defined by iOS' NSURLSession). Closes https://github.com/facebook/react-native/pull/5782 Reviewed By: svcscm Differential Revision: D2907600 Pulled By: nicklockwood fb-gh-sync-id: 8406a045904a7ddb61fe1539a0474ec27b5e9e37 --- Libraries/Network/RCTNetworking.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Network/RCTNetworking.m b/Libraries/Network/RCTNetworking.m index 5e3081343..47cbc74d2 100644 --- a/Libraries/Network/RCTNetworking.m +++ b/Libraries/Network/RCTNetworking.m @@ -411,7 +411,7 @@ RCT_EXPORT_MODULE() task.uploadProgressBlock = uploadProgressBlock; if (task.requestID) { - if (_tasksByRequestID) { + if (!_tasksByRequestID) { _tasksByRequestID = [NSMutableDictionary new]; } _tasksByRequestID[task.requestID] = task;