{"action":"created","comment":{"url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/comments/60367649","id":60367649,"diff_hunk":"@@ -48,22 +50,26 @@ final class PeopleWithBonusesFetchController {\n     }\n \n     private func fetchPeopleWithBonuses(startingFromDate date: NSDate = NSDate.init(), fetchedBonuses: [Bonus], completionBlock: (Result<[Person]>) -> Void) {\n-        let take = 100\n-        let requestTemplate = TimestampableRequestTemplate<BonusesRequestTemplate>.init(requestTemplate: BonusesRequestTemplate(), date: date, take: take)\n+        let requestTemplate = TimestampableRequestTemplate(requestTemplate: BonusesRequestTemplate(), date: date, take: self.pageSize)\n         \n-        requestSender.sendRequestForRequestTemplate(requestTemplate) { [weak self] result in\n+        requestSending.sendRequestForRequestTemplate(requestTemplate) { [weak self] result in\n             guard let strongSelf = self else {\n                 completionBlock(.Failure(PeopleWithBonususFetchControllerError.Cancelled))\n                 return\n             }\n \n             switch result {\n             case .Success(let bonuses):\n-                var allBonuses: [Bonus] = fetchedBonuses.reverse()\n+                var allBonuses: [Bonus] = fetchedBonuses\n                 allBonuses.appendContentsOf(bonuses)\n \n-                let people = allBonuses.uniqueReceivers(kPreferredPeopleCount)\n-                if people.count >= kPreferredPeopleCount || bonuses.count < take {\n+                let people = allBonuses.uniqueReceivers(strongSelf.preferredNumberOfPeople)\n+\n+                for person in people {\n+                    print(person.id)\n+                }\n+\n+                if people.count >= self?.preferredNumberOfPeople || bonuses.count < strongSelf.pageSize {","path":"GrandCentralBoard/Widgets/Bonus/Source/PeopleWithBonususFetchController.swift","position":56,"original_position":56,"commit_id":"edd35e3d137f39c09aff978e432477bb160571f5","original_commit_id":"edd35e3d137f39c09aff978e432477bb160571f5","user":{"login":"michallaskowski","id":3706309,"avatar_url":"https://avatars.githubusercontent.com/u/3706309?v=3","gravatar_id":"","url":"https://api.github.com/users/michallaskowski","html_url":"https://github.com/michallaskowski","followers_url":"https://api.github.com/users/michallaskowski/followers","following_url":"https://api.github.com/users/michallaskowski/following{/other_user}","gists_url":"https://api.github.com/users/michallaskowski/gists{/gist_id}","starred_url":"https://api.github.com/users/michallaskowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michallaskowski/subscriptions","organizations_url":"https://api.github.com/users/michallaskowski/orgs","repos_url":"https://api.github.com/users/michallaskowski/repos","events_url":"https://api.github.com/users/michallaskowski/events{/privacy}","received_events_url":"https://api.github.com/users/michallaskowski/received_events","type":"User","site_admin":false},"body":"`self?` and `strongSelf` used on the same line ","created_at":"2016-04-20T08:23:52Z","updated_at":"2016-04-20T08:23:52Z","html_url":"https://github.com/macoscope/GrandCentralBoard/pull/89#discussion_r60367649","pull_request_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89","_links":{"self":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/comments/60367649"},"html":{"href":"https://github.com/macoscope/GrandCentralBoard/pull/89#discussion_r60367649"},"pull_request":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89"}}},"pull_request":{"url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89","id":67138381,"html_url":"https://github.com/macoscope/GrandCentralBoard/pull/89","diff_url":"https://github.com/macoscope/GrandCentralBoard/pull/89.diff","patch_url":"https://github.com/macoscope/GrandCentralBoard/pull/89.patch","issue_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/89","number":89,"state":"open","locked":false,"title":"Hot fix/fix paging in peoplewithbonusesfetchcontroller","user":{"login":"Augustyniak","id":4410346,"avatar_url":"https://avatars.githubusercontent.com/u/4410346?v=3","gravatar_id":"","url":"https://api.github.com/users/Augustyniak","html_url":"https://github.com/Augustyniak","followers_url":"https://api.github.com/users/Augustyniak/followers","following_url":"https://api.github.com/users/Augustyniak/following{/other_user}","gists_url":"https://api.github.com/users/Augustyniak/gists{/gist_id}","starred_url":"https://api.github.com/users/Augustyniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Augustyniak/subscriptions","organizations_url":"https://api.github.com/users/Augustyniak/orgs","repos_url":"https://api.github.com/users/Augustyniak/repos","events_url":"https://api.github.com/users/Augustyniak/events{/privacy}","received_events_url":"https://api.github.com/users/Augustyniak/received_events","type":"User","site_admin":false},"body":"Initially I just wanted to add tests for the `PeopleWithBonusesFetchController` class. During testing I found some bugs in it and decided to fix them.\r\n\r\nCreated tests aren't perfect - mostly because there contain some nasty casting - but I still think that this PR improves overall quality of the project.","created_at":"2016-04-20T07:12:09Z","updated_at":"2016-04-20T08:23:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc3106bd3690cc572448b9f2627f7d72f95bd099","assignee":{"login":"ochococo","id":3382607,"avatar_url":"https://avatars.githubusercontent.com/u/3382607?v=3","gravatar_id":"","url":"https://api.github.com/users/ochococo","html_url":"https://github.com/ochococo","followers_url":"https://api.github.com/users/ochococo/followers","following_url":"https://api.github.com/users/ochococo/following{/other_user}","gists_url":"https://api.github.com/users/ochococo/gists{/gist_id}","starred_url":"https://api.github.com/users/ochococo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ochococo/subscriptions","organizations_url":"https://api.github.com/users/ochococo/orgs","repos_url":"https://api.github.com/users/ochococo/repos","events_url":"https://api.github.com/users/ochococo/events{/privacy}","received_events_url":"https://api.github.com/users/ochococo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89/commits","review_comments_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89/comments","review_comment_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/89/comments","statuses_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/statuses/edd35e3d137f39c09aff978e432477bb160571f5","head":{"label":"macoscope:hot-fix/fix-paging-in-peoplewithbonusesfetchcontroller","ref":"hot-fix/fix-paging-in-peoplewithbonusesfetchcontroller","sha":"edd35e3d137f39c09aff978e432477bb160571f5","user":{"login":"macoscope","id":759101,"avatar_url":"https://avatars.githubusercontent.com/u/759101?v=3","gravatar_id":"","url":"https://api.github.com/users/macoscope","html_url":"https://github.com/macoscope","followers_url":"https://api.github.com/users/macoscope/followers","following_url":"https://api.github.com/users/macoscope/following{/other_user}","gists_url":"https://api.github.com/users/macoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/macoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macoscope/subscriptions","organizations_url":"https://api.github.com/users/macoscope/orgs","repos_url":"https://api.github.com/users/macoscope/repos","events_url":"https://api.github.com/users/macoscope/events{/privacy}","received_events_url":"https://api.github.com/users/macoscope/received_events","type":"Organization","site_admin":false},"repo":{"id":49216533,"name":"GrandCentralBoard","full_name":"macoscope/GrandCentralBoard","owner":{"login":"macoscope","id":759101,"avatar_url":"https://avatars.githubusercontent.com/u/759101?v=3","gravatar_id":"","url":"https://api.github.com/users/macoscope","html_url":"https://github.com/macoscope","followers_url":"https://api.github.com/users/macoscope/followers","following_url":"https://api.github.com/users/macoscope/following{/other_user}","gists_url":"https://api.github.com/users/macoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/macoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macoscope/subscriptions","organizations_url":"https://api.github.com/users/macoscope/orgs","repos_url":"https://api.github.com/users/macoscope/repos","events_url":"https://api.github.com/users/macoscope/events{/privacy}","received_events_url":"https://api.github.com/users/macoscope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/macoscope/GrandCentralBoard","description":"Hang a TV in your open space or team room to show everyone what's up and get them up to speed.","fork":false,"url":"https://api.github.com/repos/macoscope/GrandCentralBoard","forks_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/forks","keys_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/teams","hooks_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/hooks","issue_events_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/events{/number}","events_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/events","assignees_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/assignees{/user}","branches_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/branches{/branch}","tags_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/tags","blobs_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/refs{/sha}","trees_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/statuses/{sha}","languages_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/languages","stargazers_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/stargazers","contributors_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/contributors","subscribers_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/subscribers","subscription_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/subscription","commits_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/commits{/sha}","git_commits_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/commits{/sha}","comments_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/comments{/number}","issue_comment_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/comments{/number}","contents_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/contents/{+path}","compare_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/merges","archive_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/downloads","issues_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues{/number}","pulls_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls{/number}","milestones_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/milestones{/number}","notifications_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/labels{/name}","releases_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/releases{/id}","deployments_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/deployments","created_at":"2016-01-07T16:35:08Z","updated_at":"2016-04-17T03:23:05Z","pushed_at":"2016-04-20T08:08:29Z","git_url":"git://github.com/macoscope/GrandCentralBoard.git","ssh_url":"git@github.com:macoscope/GrandCentralBoard.git","clone_url":"https://github.com/macoscope/GrandCentralBoard.git","svn_url":"https://github.com/macoscope/GrandCentralBoard","homepage":"http://macoscope.com/blog/grand-central-board-for-the-apple-tv/","size":6412,"stargazers_count":155,"watchers_count":155,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":11,"forks":7,"open_issues":11,"watchers":155,"default_branch":"mvp"}},"base":{"label":"macoscope:mvp","ref":"mvp","sha":"09caa92e8d7952d1a657b90adbca12d81dfef137","user":{"login":"macoscope","id":759101,"avatar_url":"https://avatars.githubusercontent.com/u/759101?v=3","gravatar_id":"","url":"https://api.github.com/users/macoscope","html_url":"https://github.com/macoscope","followers_url":"https://api.github.com/users/macoscope/followers","following_url":"https://api.github.com/users/macoscope/following{/other_user}","gists_url":"https://api.github.com/users/macoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/macoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macoscope/subscriptions","organizations_url":"https://api.github.com/users/macoscope/orgs","repos_url":"https://api.github.com/users/macoscope/repos","events_url":"https://api.github.com/users/macoscope/events{/privacy}","received_events_url":"https://api.github.com/users/macoscope/received_events","type":"Organization","site_admin":false},"repo":{"id":49216533,"name":"GrandCentralBoard","full_name":"macoscope/GrandCentralBoard","owner":{"login":"macoscope","id":759101,"avatar_url":"https://avatars.githubusercontent.com/u/759101?v=3","gravatar_id":"","url":"https://api.github.com/users/macoscope","html_url":"https://github.com/macoscope","followers_url":"https://api.github.com/users/macoscope/followers","following_url":"https://api.github.com/users/macoscope/following{/other_user}","gists_url":"https://api.github.com/users/macoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/macoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macoscope/subscriptions","organizations_url":"https://api.github.com/users/macoscope/orgs","repos_url":"https://api.github.com/users/macoscope/repos","events_url":"https://api.github.com/users/macoscope/events{/privacy}","received_events_url":"https://api.github.com/users/macoscope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/macoscope/GrandCentralBoard","description":"Hang a TV in your open space or team room to show everyone what's up and get them up to speed.","fork":false,"url":"https://api.github.com/repos/macoscope/GrandCentralBoard","forks_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/forks","keys_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/teams","hooks_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/hooks","issue_events_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/events{/number}","events_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/events","assignees_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/assignees{/user}","branches_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/branches{/branch}","tags_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/tags","blobs_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/refs{/sha}","trees_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/statuses/{sha}","languages_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/languages","stargazers_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/stargazers","contributors_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/contributors","subscribers_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/subscribers","subscription_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/subscription","commits_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/commits{/sha}","git_commits_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/git/commits{/sha}","comments_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/comments{/number}","issue_comment_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/comments{/number}","contents_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/contents/{+path}","compare_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/merges","archive_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/downloads","issues_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues{/number}","pulls_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls{/number}","milestones_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/milestones{/number}","notifications_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/labels{/name}","releases_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/releases{/id}","deployments_url":"https://api.github.com/repos/macoscope/GrandCentralBoard/deployments","created_at":"2016-01-07T16:35:08Z","updated_at":"2016-04-17T03:23:05Z","pushed_at":"2016-04-20T08:08:29Z","git_url":"git://github.com/macoscope/GrandCentralBoard.git","ssh_url":"git@github.com:macoscope/GrandCentralBoard.git","clone_url":"https://github.com/macoscope/GrandCentralBoard.git","svn_url":"https://github.com/macoscope/GrandCentralBoard","homepage":"http://macoscope.com/blog/grand-central-board-for-the-apple-tv/","size":6412,"stargazers_count":155,"watchers_count":155,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":11,"forks":7,"open_issues":11,"watchers":155,"default_branch":"mvp"}},"_links":{"self":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89"},"html":{"href":"https://github.com/macoscope/GrandCentralBoard/pull/89"},"issue":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/89"},"comments":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/issues/89/comments"},"review_comments":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89/comments"},"review_comment":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/pulls/89/commits"},"statuses":{"href":"https://api.github.com/repos/macoscope/GrandCentralBoard/statuses/edd35e3d137f39c09aff978e432477bb160571f5"}}}}