{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/64062778","id":64062778,"diff_hunk":"@@ -109,8 +109,9 @@ class PlanFeaturesRemote: ServiceRemoteREST {\n         return cacheDirectory.URLByAppendingPathComponent(cacheFilename)\n     }\n \n-    private func cacheResponseData(responseData: NSData?) {\n-        guard let responseData = responseData else { return }\n+    private func cacheResponseObject(responseObject: AnyObject) {\n+        let data = try? NSJSONSerialization.dataWithJSONObject(responseObject, options: NSJSONWritingOptions())","path":"WordPress/Classes/Networking/PlansFeaturesRemote.swift","position":44,"original_position":44,"commit_id":"45256db10cce88696db2988bb6ac3266f3c1577c","original_commit_id":"45256db10cce88696db2988bb6ac3266f3c1577c","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"body":"I don't like that we're re-encoding the response object into JSON, but I think the problem is that we shouldn't be caching at this layer, or cache the mapped objects instead. The proper fix would be fixing the caching headers in the API and let NSURLSession worry about caching, so I'll let this pass and will look into that instead.","created_at":"2016-05-20T15:44:40Z","updated_at":"2016-05-20T15:44:40Z","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/5412#discussion_r64062778","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/64062778"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/5412#discussion_r64062778"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412","id":70834449,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/5412","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/5412.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/5412.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/5412","number":5412,"state":"open","locked":false,"title":"Migrate Plans Remote to WordPressComRestApi","user":{"login":"SergioEstevao","id":651601,"avatar_url":"https://avatars.githubusercontent.com/u/651601?v=3","gravatar_id":"","url":"https://api.github.com/users/SergioEstevao","html_url":"https://github.com/SergioEstevao","followers_url":"https://api.github.com/users/SergioEstevao/followers","following_url":"https://api.github.com/users/SergioEstevao/following{/other_user}","gists_url":"https://api.github.com/users/SergioEstevao/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioEstevao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioEstevao/subscriptions","organizations_url":"https://api.github.com/users/SergioEstevao/orgs","repos_url":"https://api.github.com/users/SergioEstevao/repos","events_url":"https://api.github.com/users/SergioEstevao/events{/privacy}","received_events_url":"https://api.github.com/users/SergioEstevao/received_events","type":"User","site_admin":false},"body":"Refs #5245 \r\n\r\nTo test:\r\n - Login with a WP.com account\r\n- Access the option blog->plans and check if plans show correctly\r\n- Put the app offline\r\n- Go to plans again and see if the cache works.\r\n\r\nNeeds review: @koke \r\n\r\n","created_at":"2016-05-20T10:38:13Z","updated_at":"2016-05-20T15:44:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f7fd558de76a6c95c695d7e2d6c3a5093f86e53","assignee":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/54","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/milestones/6.3","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/54/labels","id":1562509,"number":54,"title":"6.3","description":"","creator":{"login":"sendhil","id":437043,"avatar_url":"https://avatars.githubusercontent.com/u/437043?v=3","gravatar_id":"","url":"https://api.github.com/users/sendhil","html_url":"https://github.com/sendhil","followers_url":"https://api.github.com/users/sendhil/followers","following_url":"https://api.github.com/users/sendhil/following{/other_user}","gists_url":"https://api.github.com/users/sendhil/gists{/gist_id}","starred_url":"https://api.github.com/users/sendhil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendhil/subscriptions","organizations_url":"https://api.github.com/users/sendhil/orgs","repos_url":"https://api.github.com/users/sendhil/repos","events_url":"https://api.github.com/users/sendhil/events{/privacy}","received_events_url":"https://api.github.com/users/sendhil/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":115,"state":"open","created_at":"2016-02-04T04:45:27Z","updated_at":"2016-05-20T14:42:00Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/5412/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/45256db10cce88696db2988bb6ac3266f3c1577c","head":{"label":"wordpress-mobile:issue/5245_migrate_plans_service_to_nsurlsession","ref":"issue/5245_migrate_plans_service_to_nsurlsession","sha":"45256db10cce88696db2988bb6ac3266f3c1577c","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/deployments","created_at":"2013-03-18T16:59:33Z","updated_at":"2016-05-20T08:55:43Z","pushed_at":"2016-05-20T15:30:24Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":499259,"stargazers_count":1037,"watchers_count":1037,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":471,"mirror_url":null,"open_issues_count":352,"forks":471,"open_issues":352,"watchers":1037,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"194154cddd23e12f085f00a5b392790541bbe5ff","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/deployments","created_at":"2013-03-18T16:59:33Z","updated_at":"2016-05-20T08:55:43Z","pushed_at":"2016-05-20T15:30:24Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":499259,"stargazers_count":1037,"watchers_count":1037,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":471,"mirror_url":null,"open_issues_count":352,"forks":471,"open_issues":352,"watchers":1037,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/5412"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/5412"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/5412/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/5412/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/45256db10cce88696db2988bb6ac3266f3c1577c"}}}}
{"actor":{"display_login":"koke"}}