{"action":"opened","number":2616,"pull_request":{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/2616","id":32078495,"html_url":"https://github.com/AFNetworking/AFNetworking/pull/2616","diff_url":"https://github.com/AFNetworking/AFNetworking/pull/2616.diff","patch_url":"https://github.com/AFNetworking/AFNetworking/pull/2616.patch","issue_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2616","number":2616,"state":"open","locked":false,"title":"Fix canceling an operation not causing isFinished to return true","user":{"login":"isair","id":988213,"avatar_url":"https://avatars.githubusercontent.com/u/988213?v=3","gravatar_id":"","url":"https://api.github.com/users/isair","html_url":"https://github.com/isair","followers_url":"https://api.github.com/users/isair/followers","following_url":"https://api.github.com/users/isair/following{/other_user}","gists_url":"https://api.github.com/users/isair/gists{/gist_id}","starred_url":"https://api.github.com/users/isair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isair/subscriptions","organizations_url":"https://api.github.com/users/isair/orgs","repos_url":"https://api.github.com/users/isair/repos","events_url":"https://api.github.com/users/isair/events{/privacy}","received_events_url":"https://api.github.com/users/isair/received_events","type":"User","site_admin":false},"body":"Search throttling was behaving strange in an app I'm working on. I later found out that this was because in my network data fetching method I was checking if there was an ongoing request by doing `fetchRequest?.finished == false`. However I later found out that when I called my method after calling `fetchRequest?.cancel()` it was still thinking there was an ongoing request because fetchRequest?.finished was equal to false. So I changed my check to `fetchRequest?.finished == false && fetchRequest?.cancelled == false` and it works now.\r\n\r\nHowever, Apple's documentation of NSOperation clearly states:\r\n\r\n\"In addition to simply exiting when an operation is cancelled, it is also important that you move a cancelled operation to the appropriate final state. Specifically, if you manage the values for the finished and executing properties yourself (perhaps because you are implementing a concurrent operation), you must update those properties accordingly. Specifically, you must change the value returned by finished to YES and the value returned by executing to NO. You must make these changes even if the operation was cancelled before it started executing.\"","created_at":"2015-03-27T02:21:05Z","updated_at":"2015-03-27T02:21:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/2616/commits","review_comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/2616/comments","review_comment_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2616/comments","statuses_url":"https://api.github.com/repos/AFNetworking/AFNetworking/statuses/1b5b4e9a59085b22093336eec4dfb5df8f751a52","head":{"label":"isair:master","ref":"master","sha":"1b5b4e9a59085b22093336eec4dfb5df8f751a52","user":{"login":"isair","id":988213,"avatar_url":"https://avatars.githubusercontent.com/u/988213?v=3","gravatar_id":"","url":"https://api.github.com/users/isair","html_url":"https://github.com/isair","followers_url":"https://api.github.com/users/isair/followers","following_url":"https://api.github.com/users/isair/following{/other_user}","gists_url":"https://api.github.com/users/isair/gists{/gist_id}","starred_url":"https://api.github.com/users/isair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isair/subscriptions","organizations_url":"https://api.github.com/users/isair/orgs","repos_url":"https://api.github.com/users/isair/repos","events_url":"https://api.github.com/users/isair/events{/privacy}","received_events_url":"https://api.github.com/users/isair/received_events","type":"User","site_admin":false},"repo":{"id":32961456,"name":"AFNetworking","full_name":"isair/AFNetworking","owner":{"login":"isair","id":988213,"avatar_url":"https://avatars.githubusercontent.com/u/988213?v=3","gravatar_id":"","url":"https://api.github.com/users/isair","html_url":"https://github.com/isair","followers_url":"https://api.github.com/users/isair/followers","following_url":"https://api.github.com/users/isair/following{/other_user}","gists_url":"https://api.github.com/users/isair/gists{/gist_id}","starred_url":"https://api.github.com/users/isair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isair/subscriptions","organizations_url":"https://api.github.com/users/isair/orgs","repos_url":"https://api.github.com/users/isair/repos","events_url":"https://api.github.com/users/isair/events{/privacy}","received_events_url":"https://api.github.com/users/isair/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isair/AFNetworking","description":"A delightful iOS and OS X networking framework","fork":true,"url":"https://api.github.com/repos/isair/AFNetworking","forks_url":"https://api.github.com/repos/isair/AFNetworking/forks","keys_url":"https://api.github.com/repos/isair/AFNetworking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isair/AFNetworking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isair/AFNetworking/teams","hooks_url":"https://api.github.com/repos/isair/AFNetworking/hooks","issue_events_url":"https://api.github.com/repos/isair/AFNetworking/issues/events{/number}","events_url":"https://api.github.com/repos/isair/AFNetworking/events","assignees_url":"https://api.github.com/repos/isair/AFNetworking/assignees{/user}","branches_url":"https://api.github.com/repos/isair/AFNetworking/branches{/branch}","tags_url":"https://api.github.com/repos/isair/AFNetworking/tags","blobs_url":"https://api.github.com/repos/isair/AFNetworking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isair/AFNetworking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isair/AFNetworking/git/refs{/sha}","trees_url":"https://api.github.com/repos/isair/AFNetworking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isair/AFNetworking/statuses/{sha}","languages_url":"https://api.github.com/repos/isair/AFNetworking/languages","stargazers_url":"https://api.github.com/repos/isair/AFNetworking/stargazers","contributors_url":"https://api.github.com/repos/isair/AFNetworking/contributors","subscribers_url":"https://api.github.com/repos/isair/AFNetworking/subscribers","subscription_url":"https://api.github.com/repos/isair/AFNetworking/subscription","commits_url":"https://api.github.com/repos/isair/AFNetworking/commits{/sha}","git_commits_url":"https://api.github.com/repos/isair/AFNetworking/git/commits{/sha}","comments_url":"https://api.github.com/repos/isair/AFNetworking/comments{/number}","issue_comment_url":"https://api.github.com/repos/isair/AFNetworking/issues/comments{/number}","contents_url":"https://api.github.com/repos/isair/AFNetworking/contents/{+path}","compare_url":"https://api.github.com/repos/isair/AFNetworking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isair/AFNetworking/merges","archive_url":"https://api.github.com/repos/isair/AFNetworking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isair/AFNetworking/downloads","issues_url":"https://api.github.com/repos/isair/AFNetworking/issues{/number}","pulls_url":"https://api.github.com/repos/isair/AFNetworking/pulls{/number}","milestones_url":"https://api.github.com/repos/isair/AFNetworking/milestones{/number}","notifications_url":"https://api.github.com/repos/isair/AFNetworking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isair/AFNetworking/labels{/name}","releases_url":"https://api.github.com/repos/isair/AFNetworking/releases{/id}","created_at":"2015-03-27T01:31:11Z","updated_at":"2015-03-27T02:17:27Z","pushed_at":"2015-03-27T02:17:26Z","git_url":"git://github.com/isair/AFNetworking.git","ssh_url":"git@github.com:isair/AFNetworking.git","clone_url":"https://github.com/isair/AFNetworking.git","svn_url":"https://github.com/isair/AFNetworking","homepage":"http://afnetworking.com","size":5507,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AFNetworking:master","ref":"master","sha":"b0dd3d98346e98c9b1700ddd083559d7d4f15a68","user":{"login":"AFNetworking","id":1181541,"avatar_url":"https://avatars.githubusercontent.com/u/1181541?v=3","gravatar_id":"","url":"https://api.github.com/users/AFNetworking","html_url":"https://github.com/AFNetworking","followers_url":"https://api.github.com/users/AFNetworking/followers","following_url":"https://api.github.com/users/AFNetworking/following{/other_user}","gists_url":"https://api.github.com/users/AFNetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/AFNetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AFNetworking/subscriptions","organizations_url":"https://api.github.com/users/AFNetworking/orgs","repos_url":"https://api.github.com/users/AFNetworking/repos","events_url":"https://api.github.com/users/AFNetworking/events{/privacy}","received_events_url":"https://api.github.com/users/AFNetworking/received_events","type":"Organization","site_admin":false},"repo":{"id":1828795,"name":"AFNetworking","full_name":"AFNetworking/AFNetworking","owner":{"login":"AFNetworking","id":1181541,"avatar_url":"https://avatars.githubusercontent.com/u/1181541?v=3","gravatar_id":"","url":"https://api.github.com/users/AFNetworking","html_url":"https://github.com/AFNetworking","followers_url":"https://api.github.com/users/AFNetworking/followers","following_url":"https://api.github.com/users/AFNetworking/following{/other_user}","gists_url":"https://api.github.com/users/AFNetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/AFNetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AFNetworking/subscriptions","organizations_url":"https://api.github.com/users/AFNetworking/orgs","repos_url":"https://api.github.com/users/AFNetworking/repos","events_url":"https://api.github.com/users/AFNetworking/events{/privacy}","received_events_url":"https://api.github.com/users/AFNetworking/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AFNetworking/AFNetworking","description":"A delightful iOS and OS X networking framework","fork":false,"url":"https://api.github.com/repos/AFNetworking/AFNetworking","forks_url":"https://api.github.com/repos/AFNetworking/AFNetworking/forks","keys_url":"https://api.github.com/repos/AFNetworking/AFNetworking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AFNetworking/AFNetworking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AFNetworking/AFNetworking/teams","hooks_url":"https://api.github.com/repos/AFNetworking/AFNetworking/hooks","issue_events_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/events{/number}","events_url":"https://api.github.com/repos/AFNetworking/AFNetworking/events","assignees_url":"https://api.github.com/repos/AFNetworking/AFNetworking/assignees{/user}","branches_url":"https://api.github.com/repos/AFNetworking/AFNetworking/branches{/branch}","tags_url":"https://api.github.com/repos/AFNetworking/AFNetworking/tags","blobs_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/refs{/sha}","trees_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AFNetworking/AFNetworking/statuses/{sha}","languages_url":"https://api.github.com/repos/AFNetworking/AFNetworking/languages","stargazers_url":"https://api.github.com/repos/AFNetworking/AFNetworking/stargazers","contributors_url":"https://api.github.com/repos/AFNetworking/AFNetworking/contributors","subscribers_url":"https://api.github.com/repos/AFNetworking/AFNetworking/subscribers","subscription_url":"https://api.github.com/repos/AFNetworking/AFNetworking/subscription","commits_url":"https://api.github.com/repos/AFNetworking/AFNetworking/commits{/sha}","git_commits_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/commits{/sha}","comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/comments{/number}","issue_comment_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/comments{/number}","contents_url":"https://api.github.com/repos/AFNetworking/AFNetworking/contents/{+path}","compare_url":"https://api.github.com/repos/AFNetworking/AFNetworking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AFNetworking/AFNetworking/merges","archive_url":"https://api.github.com/repos/AFNetworking/AFNetworking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AFNetworking/AFNetworking/downloads","issues_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues{/number}","pulls_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls{/number}","milestones_url":"https://api.github.com/repos/AFNetworking/AFNetworking/milestones{/number}","notifications_url":"https://api.github.com/repos/AFNetworking/AFNetworking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AFNetworking/AFNetworking/labels{/name}","releases_url":"https://api.github.com/repos/AFNetworking/AFNetworking/releases{/id}","created_at":"2011-05-31T21:28:44Z","updated_at":"2015-03-27T02:11:11Z","pushed_at":"2015-03-26T22:16:11Z","git_url":"git://github.com/AFNetworking/AFNetworking.git","ssh_url":"git@github.com:AFNetworking/AFNetworking.git","clone_url":"https://github.com/AFNetworking/AFNetworking.git","svn_url":"https://github.com/AFNetworking/AFNetworking","homepage":"http://afnetworking.com","size":15059,"stargazers_count":16392,"watchers_count":16392,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4705,"mirror_url":null,"open_issues_count":24,"forks":4705,"open_issues":24,"watchers":16392,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/2616"},"html":{"href":"https://github.com/AFNetworking/AFNetworking/pull/2616"},"issue":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2616"},"comments":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/2616/comments"},"review_comments":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/2616/comments"},"review_comment":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/2616/commits"},"statuses":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/statuses/1b5b4e9a59085b22093336eec4dfb5df8f751a52"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":0,"changed_files":1}}