{"action":"created","comment":{"url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/comments/28983794","id":28983794,"diff_hunk":"@@ -39,6 +54,13 @@ - (instancetype)initWithDatastore:(CDTDatastore *)datastore\n \n - (void)main\n {\n+    // Ensure our settings are not changed during execution\n+    self.mDocumentChangedBlock = self.documentChangedBlock;\n+    self.mDocumentWithIDWasDeletedBlock = self.documentWithIDWasDeletedBlock;\n+    self.mFetchRecordChangesCompletionBlock = self.fetchRecordChangesCompletionBlock;\n+    self.mDatastore = self.datastore;\n+    self.mStartSequenceValue = self.startSequenceValue;","path":"Classes/common/CDTFetchChanges.m","position":31,"original_position":31,"commit_id":"629c0b6656aa0b13b4625805b2dcdb4cb229a15c","original_commit_id":"629c0b6656aa0b13b4625805b2dcdb4cb229a15c","user":{"login":"gadamc","id":623360,"avatar_url":"https://avatars.githubusercontent.com/u/623360?v=3","gravatar_id":"","url":"https://api.github.com/users/gadamc","html_url":"https://github.com/gadamc","followers_url":"https://api.github.com/users/gadamc/followers","following_url":"https://api.github.com/users/gadamc/following{/other_user}","gists_url":"https://api.github.com/users/gadamc/gists{/gist_id}","starred_url":"https://api.github.com/users/gadamc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gadamc/subscriptions","organizations_url":"https://api.github.com/users/gadamc/orgs","repos_url":"https://api.github.com/users/gadamc/repos","events_url":"https://api.github.com/users/gadamc/events{/privacy}","received_events_url":"https://api.github.com/users/gadamc/received_events","type":"User","site_admin":false},"body":"On the other hand, I now realize one could write a \"completed\" block that simply reacts differently based upon the accumulated knowledge received during the 'changes' and 'deleted' blocks... which means there wouldn't be a need to set a different \"completion\" block. The users's completion block would contain the logic. ","created_at":"2015-04-23T17:26:53Z","updated_at":"2015-04-23T17:26:53Z","html_url":"https://github.com/cloudant/CDTDatastore/pull/125#discussion_r28983794","pull_request_url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/comments/28983794"},"html":{"href":"https://github.com/cloudant/CDTDatastore/pull/125#discussion_r28983794"},"pull_request":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125","id":33271328,"html_url":"https://github.com/cloudant/CDTDatastore/pull/125","diff_url":"https://github.com/cloudant/CDTDatastore/pull/125.diff","patch_url":"https://github.com/cloudant/CDTDatastore/pull/125.patch","issue_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/125","number":125,"state":"open","locked":false,"title":"Support cancelling of CDTFetchChanges","user":{"login":"mikerhodes","id":453210,"avatar_url":"https://avatars.githubusercontent.com/u/453210?v=3","gravatar_id":"","url":"https://api.github.com/users/mikerhodes","html_url":"https://github.com/mikerhodes","followers_url":"https://api.github.com/users/mikerhodes/followers","following_url":"https://api.github.com/users/mikerhodes/following{/other_user}","gists_url":"https://api.github.com/users/mikerhodes/gists{/gist_id}","starred_url":"https://api.github.com/users/mikerhodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikerhodes/subscriptions","organizations_url":"https://api.github.com/users/mikerhodes/orgs","repos_url":"https://api.github.com/users/mikerhodes/repos","events_url":"https://api.github.com/users/mikerhodes/events{/privacy}","received_events_url":"https://api.github.com/users/mikerhodes/received_events","type":"User","site_admin":false},"body":"_What_\r\n\r\nWe now periodically check for the NSOperation's cancelled\r\nproperty and bail early rather than always running the whole\r\nchanges fetch process.\r\n\r\n_How_\r\n\r\nReturning early from methods if the cancel state is set.\r\n\r\nreviewer: @indisoluble \r\nreviewer: @gadamc\r\n\r\nBugId: 46038","created_at":"2015-04-14T15:50:26Z","updated_at":"2015-04-23T17:26:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d742d6579a059fe51939909112fc7d61f65f42b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125/commits","review_comments_url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125/comments","review_comment_url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/125/comments","statuses_url":"https://api.github.com/repos/cloudant/CDTDatastore/statuses/629c0b6656aa0b13b4625805b2dcdb4cb229a15c","head":{"label":"cloudant:46038-cancellable-fetchchanges","ref":"46038-cancellable-fetchchanges","sha":"629c0b6656aa0b13b4625805b2dcdb4cb229a15c","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":15022868,"name":"CDTDatastore","full_name":"cloudant/CDTDatastore","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/CDTDatastore","description":"Cloudant Sync iOS datastore library.","fork":false,"url":"https://api.github.com/repos/cloudant/CDTDatastore","forks_url":"https://api.github.com/repos/cloudant/CDTDatastore/forks","keys_url":"https://api.github.com/repos/cloudant/CDTDatastore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/CDTDatastore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/CDTDatastore/teams","hooks_url":"https://api.github.com/repos/cloudant/CDTDatastore/hooks","issue_events_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/CDTDatastore/events","assignees_url":"https://api.github.com/repos/cloudant/CDTDatastore/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/CDTDatastore/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/CDTDatastore/tags","blobs_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/CDTDatastore/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/CDTDatastore/languages","stargazers_url":"https://api.github.com/repos/cloudant/CDTDatastore/stargazers","contributors_url":"https://api.github.com/repos/cloudant/CDTDatastore/contributors","subscribers_url":"https://api.github.com/repos/cloudant/CDTDatastore/subscribers","subscription_url":"https://api.github.com/repos/cloudant/CDTDatastore/subscription","commits_url":"https://api.github.com/repos/cloudant/CDTDatastore/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/CDTDatastore/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/CDTDatastore/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/CDTDatastore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/CDTDatastore/merges","archive_url":"https://api.github.com/repos/cloudant/CDTDatastore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/CDTDatastore/downloads","issues_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/CDTDatastore/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/CDTDatastore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/CDTDatastore/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/CDTDatastore/releases{/id}","created_at":"2013-12-08T11:59:05Z","updated_at":"2015-04-21T13:22:05Z","pushed_at":"2015-04-23T10:09:12Z","git_url":"git://github.com/cloudant/CDTDatastore.git","ssh_url":"git@github.com:cloudant/CDTDatastore.git","clone_url":"https://github.com/cloudant/CDTDatastore.git","svn_url":"https://github.com/cloudant/CDTDatastore","homepage":null,"size":8581,"stargazers_count":70,"watchers_count":70,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":8,"forks":13,"open_issues":8,"watchers":70,"default_branch":"master"}},"base":{"label":"cloudant:master","ref":"master","sha":"fe933d0e7765972068a4f32d67468b70872ee440","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":15022868,"name":"CDTDatastore","full_name":"cloudant/CDTDatastore","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/CDTDatastore","description":"Cloudant Sync iOS datastore library.","fork":false,"url":"https://api.github.com/repos/cloudant/CDTDatastore","forks_url":"https://api.github.com/repos/cloudant/CDTDatastore/forks","keys_url":"https://api.github.com/repos/cloudant/CDTDatastore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/CDTDatastore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/CDTDatastore/teams","hooks_url":"https://api.github.com/repos/cloudant/CDTDatastore/hooks","issue_events_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/CDTDatastore/events","assignees_url":"https://api.github.com/repos/cloudant/CDTDatastore/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/CDTDatastore/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/CDTDatastore/tags","blobs_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/CDTDatastore/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/CDTDatastore/languages","stargazers_url":"https://api.github.com/repos/cloudant/CDTDatastore/stargazers","contributors_url":"https://api.github.com/repos/cloudant/CDTDatastore/contributors","subscribers_url":"https://api.github.com/repos/cloudant/CDTDatastore/subscribers","subscription_url":"https://api.github.com/repos/cloudant/CDTDatastore/subscription","commits_url":"https://api.github.com/repos/cloudant/CDTDatastore/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/CDTDatastore/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/CDTDatastore/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/CDTDatastore/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/CDTDatastore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/CDTDatastore/merges","archive_url":"https://api.github.com/repos/cloudant/CDTDatastore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/CDTDatastore/downloads","issues_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/CDTDatastore/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/CDTDatastore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/CDTDatastore/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/CDTDatastore/releases{/id}","created_at":"2013-12-08T11:59:05Z","updated_at":"2015-04-21T13:22:05Z","pushed_at":"2015-04-23T10:09:12Z","git_url":"git://github.com/cloudant/CDTDatastore.git","ssh_url":"git@github.com:cloudant/CDTDatastore.git","clone_url":"https://github.com/cloudant/CDTDatastore.git","svn_url":"https://github.com/cloudant/CDTDatastore","homepage":null,"size":8581,"stargazers_count":70,"watchers_count":70,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":8,"forks":13,"open_issues":8,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125"},"html":{"href":"https://github.com/cloudant/CDTDatastore/pull/125"},"issue":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/issues/125"},"comments":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/cloudant/CDTDatastore/statuses/629c0b6656aa0b13b4625805b2dcdb4cb229a15c"}}}}