New Progress Reporting API using `NSProgress` by kcharwood · Pull Request #3187 · AFNetworking/AFNetworking
kcharwood
changed the title
New Progress Reporting API
New Progress Reporting API using NSProgress
These changes expose a simpler, block based progress reporting API, while maintaining the ability for more advanced features using KVO on NSProgress.
kcharwood added a commit that referenced this pull request
Dec 4, 2015
kcharwood
deleted the
feature/progress_improvement
branch
coreyfloyd added a commit to wikimedia/AFNetworking that referenced this pull request
Jul 6, 2016The impetus for this change was a bug related to: https://github.com/AFNetworking/AFNetworking/issues/3380 Which points to an issue where AFURLSessionManager could get in a state where it does not inform the AFURLSessionManagerTaskDelegate to un-observe cancelled (or otherwise completed) tasks before they are deallocated. While the above issue is specific to background tasks/sessions, we have observed it on sessions with default configurations as well. Instead of debugging the KVO issues, I decided to replace the KVO code with in favor of the appropriate NSURLSession delegate methods. Running all unit tests shows that this approach appears to be working. The pull request that made this change (AFNetworking#3187) mentions that its goal was to remove the need for AFNetworking API consumers to use a KVO API for getting progress. This makes sense, but I was unable to see any reason why KVO was used internally for getting progress information rather than the NSURLSession Delegate methods. Because of this, It isn't clear to me what the historical reasons were/are for KVO being needed to satisfy the progress requirements of the AFNetworking API. With any luck, KVO is no longer needed and we can eliminate this class of crashes by eliminating KVO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters