{"action":"created","issue":{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2709","labels_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2709/labels{/name}","comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2709/comments","events_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2709/events","html_url":"https://github.com/AFNetworking/AFNetworking/issues/2709","id":74507878,"number":2709,"title":"A GET Request never updates AFURLSessionManager Progress","user":{"login":"AlexmReynolds","id":836186,"avatar_url":"https://avatars.githubusercontent.com/u/836186?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexmReynolds","html_url":"https://github.com/AlexmReynolds","followers_url":"https://api.github.com/users/AlexmReynolds/followers","following_url":"https://api.github.com/users/AlexmReynolds/following{/other_user}","gists_url":"https://api.github.com/users/AlexmReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexmReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexmReynolds/subscriptions","organizations_url":"https://api.github.com/users/AlexmReynolds/orgs","repos_url":"https://api.github.com/users/AlexmReynolds/repos","events_url":"https://api.github.com/users/AlexmReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/AlexmReynolds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-08T21:52:11Z","updated_at":"2015-05-15T14:24:01Z","closed_at":null,"body":"I'm using my own `NSProgress` for a synchronization task. I was getting odd unresolved child progresses. I found that they are created by AFNetworking in the init method of `AFURLSessionManager`. Seems that the `totalUnitCount` and `completedUnitCount` are never set. I'm not sure if that is because the server I hit does not send back data length but either way in `URLSession:task:didCompleteWithError` we should resolve the progress to the total bytes in `self.mutableData` so there is never a dangling progress. Additionally since we are setting the `totalUnitsCount` after we initialize the `NSProgress` we should initialize that progress with a total of -1 which means indeterminate.\r\n\r\nI think these lines of code will fix it but I wanted to check first to see if the issue is a real bug or I am missing some delegate call or option.\r\n\r\n    @implementation AFURLSessionManagerTaskDelegate\r\n\r\n    - (instancetype)init {\r\n        self = [super init];\r\n        if (!self) {\r\n            return nil;\r\n        }\r\n    \r\n        self.mutableData = [NSMutableData data];\r\n\r\n        self.progress = [NSProgress progressWithTotalUnitCount:-1];\r\n\r\n        return self;\r\n    } \r\n\r\nThen line 163 of the same file\r\n\r\n     if(self.progress.indeterminate){\r\n        self.progress.totalUnitCount = self.mutableData.length;\r\n        self.progress.completedUnitCount = self.mutableData.length;\r\n    }"},"comment":{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/comments/102412704","html_url":"https://github.com/AFNetworking/AFNetworking/issues/2709#issuecomment-102412704","issue_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2709","id":102412704,"user":{"login":"kcharwood","id":198768,"avatar_url":"https://avatars.githubusercontent.com/u/198768?v=3","gravatar_id":"","url":"https://api.github.com/users/kcharwood","html_url":"https://github.com/kcharwood","followers_url":"https://api.github.com/users/kcharwood/followers","following_url":"https://api.github.com/users/kcharwood/following{/other_user}","gists_url":"https://api.github.com/users/kcharwood/gists{/gist_id}","starred_url":"https://api.github.com/users/kcharwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kcharwood/subscriptions","organizations_url":"https://api.github.com/users/kcharwood/orgs","repos_url":"https://api.github.com/users/kcharwood/repos","events_url":"https://api.github.com/users/kcharwood/events{/privacy}","received_events_url":"https://api.github.com/users/kcharwood/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T14:24:01Z","updated_at":"2015-05-15T14:24:01Z","body":"Would you be willing to put together a pull request and some tests demonstrating this fix?\r\n\r\n:beers:"}}