Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
When tasks are created on a concurrent queue, incorrect completionHandlers can get called. #2093
Due to this bug: http://openradar.appspot.com/radar?id=5871104061079552 in NSURLSessionTask, creating tasks on a concurrent queue can cause incorrect completionHandlers to get called.
When a duplicate taskIdentifier is returned by the task, the previous completionHandler gets cleared out and replaced with the new one. If the data for the first request comes back before the second request's data, the first response is then called against the second completionHandler.
I'm not sure what AFNetworking should do here — it could enforce creating tasks on a serial queue or it could just advise people to do so. We could also add a test to assert that the taskIdentifier is not a duplicate?
Yeah, that would certainly work. I'll update this task if my radar gets closed.
added a commit
Jun 22, 2014
@matt, we know that bug fixed in iOS 8+, should we support creation_queue in iOS 8+ versions?