{"action":"created","comment":{"url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/comments/89220374","pull_request_review_id":9766845,"id":89220374,"diff_hunk":"@@ -63,7 +72,31 @@ open class NetworkUploadProcedure<Session: URLSessionTaskFactory>: Procedure, Re\n             strongSelf.finish()\n         }\n \n+        task?.addObserver(self, forKeyPath: #keyPath(URLSessionTaskProgressProtocol.countOfBytesExpectedToSend), options: [.new, .old], context: &observerContext)\n+        task?.addObserver(self, forKeyPath: #keyPath(URLSessionTaskProgressProtocol.countOfBytesSent), options: [.new, .old], context: &observerContext)\n+\n         task?.resume()\n     }\n \n+    override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {\n+        guard context == &observerContext else {\n+            super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)\n+            return\n+        }\n+\n+        if let keyPath = keyPath, let task = object as? Session.UploadTask {\n+            switch keyPath {\n+            case #keyPath(URLSessionTaskProgressProtocol.countOfBytesExpectedToSend):\n+                progress.totalUnitCount = task.countOfBytesExpectedToSend\n+            case #keyPath(URLSessionTaskProgressProtocol.countOfBytesSent):\n+                progress.completedUnitCount = task.countOfBytesSent\n+            case #keyPath(URLSessionTaskProgressProtocol.countOfBytesExpectedToReceive):\n+                progress.totalUnitCount = task.countOfBytesExpectedToReceive\n+            case #keyPath(URLSessionTaskProgressProtocol.countOfBytesReceived):","path":"Sources/Network/NetworkUpload.swift","position":67,"original_position":67,"commit_id":"3f483e1dbe54568451c20e14fb54ac915ca3fffd","original_commit_id":"3f483e1dbe54568451c20e14fb54ac915ca3fffd","user":{"login":"swiftlyfalling","id":18540905,"avatar_url":"https://avatars.githubusercontent.com/u/18540905?v=3","gravatar_id":"","url":"https://api.github.com/users/swiftlyfalling","html_url":"https://github.com/swiftlyfalling","followers_url":"https://api.github.com/users/swiftlyfalling/followers","following_url":"https://api.github.com/users/swiftlyfalling/following{/other_user}","gists_url":"https://api.github.com/users/swiftlyfalling/gists{/gist_id}","starred_url":"https://api.github.com/users/swiftlyfalling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swiftlyfalling/subscriptions","organizations_url":"https://api.github.com/users/swiftlyfalling/orgs","repos_url":"https://api.github.com/users/swiftlyfalling/repos","events_url":"https://api.github.com/users/swiftlyfalling/events{/privacy}","received_events_url":"https://api.github.com/users/swiftlyfalling/received_events","type":"User","site_admin":false},"body":"It seems like this case is unnecessary for `NetworkUploadProcedure`? (It's not being registered for KVO.)","created_at":"2016-11-22T22:05:24Z","updated_at":"2016-11-22T22:17:59Z","html_url":"https://github.com/ProcedureKit/ProcedureKit/pull/604#discussion_r89220374","pull_request_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604","_links":{"self":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/comments/89220374"},"html":{"href":"https://github.com/ProcedureKit/ProcedureKit/pull/604#discussion_r89220374"},"pull_request":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604"}}},"pull_request":{"url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604","id":94904441,"html_url":"https://github.com/ProcedureKit/ProcedureKit/pull/604","diff_url":"https://github.com/ProcedureKit/ProcedureKit/pull/604.diff","patch_url":"https://github.com/ProcedureKit/ProcedureKit/pull/604.patch","issue_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues/604","number":604,"state":"open","locked":false,"title":"OPR-595 NetworkProcedure Progress","user":{"login":"blg-andreasbraun","id":11517486,"avatar_url":"https://avatars.githubusercontent.com/u/11517486?v=3","gravatar_id":"","url":"https://api.github.com/users/blg-andreasbraun","html_url":"https://github.com/blg-andreasbraun","followers_url":"https://api.github.com/users/blg-andreasbraun/followers","following_url":"https://api.github.com/users/blg-andreasbraun/following{/other_user}","gists_url":"https://api.github.com/users/blg-andreasbraun/gists{/gist_id}","starred_url":"https://api.github.com/users/blg-andreasbraun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blg-andreasbraun/subscriptions","organizations_url":"https://api.github.com/users/blg-andreasbraun/orgs","repos_url":"https://api.github.com/users/blg-andreasbraun/repos","events_url":"https://api.github.com/users/blg-andreasbraun/events{/privacy}","received_events_url":"https://api.github.com/users/blg-andreasbraun/received_events","type":"User","site_admin":false},"body":"There are no tests right now. Unfortunately I have not figured out how to properly test this functionality.\r\nIf someone has ideas, I'd like to hear them :)","created_at":"2016-11-22T21:46:53Z","updated_at":"2016-11-22T22:17:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b61653515715e75564630ce41f0a74fe99c4a9b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604/commits","review_comments_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604/comments","review_comment_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues/604/comments","statuses_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/statuses/3f483e1dbe54568451c20e14fb54ac915ca3fffd","head":{"label":"blg-andreasbraun:feature/OPR-595_networkprocedure_progress","ref":"feature/OPR-595_networkprocedure_progress","sha":"3f483e1dbe54568451c20e14fb54ac915ca3fffd","user":{"login":"blg-andreasbraun","id":11517486,"avatar_url":"https://avatars.githubusercontent.com/u/11517486?v=3","gravatar_id":"","url":"https://api.github.com/users/blg-andreasbraun","html_url":"https://github.com/blg-andreasbraun","followers_url":"https://api.github.com/users/blg-andreasbraun/followers","following_url":"https://api.github.com/users/blg-andreasbraun/following{/other_user}","gists_url":"https://api.github.com/users/blg-andreasbraun/gists{/gist_id}","starred_url":"https://api.github.com/users/blg-andreasbraun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blg-andreasbraun/subscriptions","organizations_url":"https://api.github.com/users/blg-andreasbraun/orgs","repos_url":"https://api.github.com/users/blg-andreasbraun/repos","events_url":"https://api.github.com/users/blg-andreasbraun/events{/privacy}","received_events_url":"https://api.github.com/users/blg-andreasbraun/received_events","type":"User","site_admin":false},"repo":{"id":58496109,"name":"ProcedureKit","full_name":"blg-andreasbraun/ProcedureKit","owner":{"login":"blg-andreasbraun","id":11517486,"avatar_url":"https://avatars.githubusercontent.com/u/11517486?v=3","gravatar_id":"","url":"https://api.github.com/users/blg-andreasbraun","html_url":"https://github.com/blg-andreasbraun","followers_url":"https://api.github.com/users/blg-andreasbraun/followers","following_url":"https://api.github.com/users/blg-andreasbraun/following{/other_user}","gists_url":"https://api.github.com/users/blg-andreasbraun/gists{/gist_id}","starred_url":"https://api.github.com/users/blg-andreasbraun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blg-andreasbraun/subscriptions","organizations_url":"https://api.github.com/users/blg-andreasbraun/orgs","repos_url":"https://api.github.com/users/blg-andreasbraun/repos","events_url":"https://api.github.com/users/blg-andreasbraun/events{/privacy}","received_events_url":"https://api.github.com/users/blg-andreasbraun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blg-andreasbraun/ProcedureKit","description":"A Swift framework inspired by WWDC 2015 Advanced NSOperations session.","fork":true,"url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit","forks_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/forks","keys_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/teams","hooks_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/hooks","issue_events_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/issues/events{/number}","events_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/events","assignees_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/assignees{/user}","branches_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/branches{/branch}","tags_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/tags","blobs_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/statuses/{sha}","languages_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/languages","stargazers_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/stargazers","contributors_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/contributors","subscribers_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/subscribers","subscription_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/subscription","commits_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/contents/{+path}","compare_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/merges","archive_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/downloads","issues_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/issues{/number}","pulls_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/pulls{/number}","milestones_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/milestones{/number}","notifications_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/labels{/name}","releases_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/releases{/id}","deployments_url":"https://api.github.com/repos/blg-andreasbraun/ProcedureKit/deployments","created_at":"2016-05-10T21:58:25Z","updated_at":"2016-11-21T18:20:13Z","pushed_at":"2016-11-22T21:57:00Z","git_url":"git://github.com/blg-andreasbraun/ProcedureKit.git","ssh_url":"git@github.com:blg-andreasbraun/ProcedureKit.git","clone_url":"https://github.com/blg-andreasbraun/ProcedureKit.git","svn_url":"https://github.com/blg-andreasbraun/ProcedureKit","homepage":"","size":10743,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"ProcedureKit:development","ref":"development","sha":"88adad0a74329a6993b5922cda3ccd64f5142114","user":{"login":"ProcedureKit","id":19939747,"avatar_url":"https://avatars.githubusercontent.com/u/19939747?v=3","gravatar_id":"","url":"https://api.github.com/users/ProcedureKit","html_url":"https://github.com/ProcedureKit","followers_url":"https://api.github.com/users/ProcedureKit/followers","following_url":"https://api.github.com/users/ProcedureKit/following{/other_user}","gists_url":"https://api.github.com/users/ProcedureKit/gists{/gist_id}","starred_url":"https://api.github.com/users/ProcedureKit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProcedureKit/subscriptions","organizations_url":"https://api.github.com/users/ProcedureKit/orgs","repos_url":"https://api.github.com/users/ProcedureKit/repos","events_url":"https://api.github.com/users/ProcedureKit/events{/privacy}","received_events_url":"https://api.github.com/users/ProcedureKit/received_events","type":"Organization","site_admin":false},"repo":{"id":38116404,"name":"ProcedureKit","full_name":"ProcedureKit/ProcedureKit","owner":{"login":"ProcedureKit","id":19939747,"avatar_url":"https://avatars.githubusercontent.com/u/19939747?v=3","gravatar_id":"","url":"https://api.github.com/users/ProcedureKit","html_url":"https://github.com/ProcedureKit","followers_url":"https://api.github.com/users/ProcedureKit/followers","following_url":"https://api.github.com/users/ProcedureKit/following{/other_user}","gists_url":"https://api.github.com/users/ProcedureKit/gists{/gist_id}","starred_url":"https://api.github.com/users/ProcedureKit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProcedureKit/subscriptions","organizations_url":"https://api.github.com/users/ProcedureKit/orgs","repos_url":"https://api.github.com/users/ProcedureKit/repos","events_url":"https://api.github.com/users/ProcedureKit/events{/privacy}","received_events_url":"https://api.github.com/users/ProcedureKit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ProcedureKit/ProcedureKit","description":"Advanced Operations in Swift","fork":false,"url":"https://api.github.com/repos/ProcedureKit/ProcedureKit","forks_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/forks","keys_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/teams","hooks_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/hooks","issue_events_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues/events{/number}","events_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/events","assignees_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/assignees{/user}","branches_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/branches{/branch}","tags_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/tags","blobs_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/statuses/{sha}","languages_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/languages","stargazers_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/stargazers","contributors_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/contributors","subscribers_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/subscribers","subscription_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/subscription","commits_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/contents/{+path}","compare_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/merges","archive_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/downloads","issues_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues{/number}","pulls_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls{/number}","milestones_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/milestones{/number}","notifications_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/labels{/name}","releases_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/releases{/id}","deployments_url":"https://api.github.com/repos/ProcedureKit/ProcedureKit/deployments","created_at":"2015-06-26T14:44:38Z","updated_at":"2016-11-22T03:51:04Z","pushed_at":"2016-11-22T21:46:53Z","git_url":"git://github.com/ProcedureKit/ProcedureKit.git","ssh_url":"git@github.com:ProcedureKit/ProcedureKit.git","clone_url":"https://github.com/ProcedureKit/ProcedureKit.git","svn_url":"https://github.com/ProcedureKit/ProcedureKit","homepage":"","size":12176,"stargazers_count":430,"watchers_count":430,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":25,"forks":60,"open_issues":25,"watchers":430,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604"},"html":{"href":"https://github.com/ProcedureKit/ProcedureKit/pull/604"},"issue":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues/604"},"comments":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/issues/604/comments"},"review_comments":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604/comments"},"review_comment":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/pulls/604/commits"},"statuses":{"href":"https://api.github.com/repos/ProcedureKit/ProcedureKit/statuses/3f483e1dbe54568451c20e14fb54ac915ca3fffd"}}}}
{"actor":{"display_login":"swiftlyfalling"}}