{"action":"created","comment":{"url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments/101907276","pull_request_review_id":22650713,"id":101907276,"diff_hunk":"@@ -1,19 +1,45 @@\n class MyAnimeListListWorker\n   include Sidekiq::Worker\n \n-  def perform(user_id)\n-    kitsu_library(user_id).each do |library_entry_id|\n+  def perform(linked_account_id, user_id)\n+    kitsu_library(user_id).each do |library_entry|\n+      # create the logs here before the next worker\n+      library_entry_log = create_log(library_entry, linked_account_id)\n+\n       MyAnimeListSyncWorker.perform_async(\n-        library_entry_id: library_entry_id,\n-        method: 'create/update'\n+        library_entry_id: library_entry.id,\n+        # HACK: I am unable to determine the method\n+        # through the initial sync because I don't access their\n+        # mal list. For now everything will be a create action,\n+        # but at some point we can update to get the correct action.\n+        # Same issue with the LibraryEntryLog performed_action\n+        method: 'create',","path":"app/workers/my_anime_list_list_worker.rb","position":20,"original_position":20,"commit_id":"78804a9aa2cec72737a5a1b701a5b01912bedf38","original_commit_id":"78804a9aa2cec72737a5a1b701a5b01912bedf38","user":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"body":"Like if we _really_ wanted to be nitpicky, we would update the `method` right here:\r\n```\r\n      if media_type == 'anime' && response['watched_status']\r\n      elsif media_type == 'anime'\r\n```\r\nso that we get a 100% accurate `action_performed` but I don't think it matters that much. \r\n\r\n","created_at":"2017-02-19T02:23:06Z","updated_at":"2017-02-19T02:23:06Z","html_url":"https://github.com/hummingbird-me/hummingbird-server/pull/52#discussion_r101907276","pull_request_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments/101907276"},"html":{"href":"https://github.com/hummingbird-me/hummingbird-server/pull/52#discussion_r101907276"},"pull_request":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52","id":104282867,"html_url":"https://github.com/hummingbird-me/hummingbird-server/pull/52","diff_url":"https://github.com/hummingbird-me/hummingbird-server/pull/52.diff","patch_url":"https://github.com/hummingbird-me/hummingbird-server/pull/52.patch","issue_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/52","number":52,"state":"open","locked":false,"title":"[WIP]: Library entry logs for MyAnimeList sync","user":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"body":"Some things I am worried about\r\n\r\n1. will the `log` get created in time (like the log being created before the worker is called)\r\n2. is the way I deal with `action_performed` ok, the `action_performed` is kind of a lie with the initial sync (so when you create a `LinkedAccount`). Personally I don't think it was a big deal but just wanted to bring to your attention.\r\n\r\n3. I will add the controller (forgot to do that)","created_at":"2017-02-02T06:39:46Z","updated_at":"2017-02-19T02:23:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b244ae92793190a980a66cd50060b695f1af6aed","assignee":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"assignees":[{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52/commits","review_comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52/comments","review_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/52/comments","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/statuses/78804a9aa2cec72737a5a1b701a5b01912bedf38","head":{"label":"toyhammered:library-entry-logs","ref":"library-entry-logs","sha":"78804a9aa2cec72737a5a1b701a5b01912bedf38","user":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"repo":{"id":70123540,"name":"hummingbird-server","full_name":"toyhammered/hummingbird-server","owner":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/toyhammered/hummingbird-server","description":"Rails API server for Hummingbird.me","fork":true,"url":"https://api.github.com/repos/toyhammered/hummingbird-server","forks_url":"https://api.github.com/repos/toyhammered/hummingbird-server/forks","keys_url":"https://api.github.com/repos/toyhammered/hummingbird-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toyhammered/hummingbird-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toyhammered/hummingbird-server/teams","hooks_url":"https://api.github.com/repos/toyhammered/hummingbird-server/hooks","issue_events_url":"https://api.github.com/repos/toyhammered/hummingbird-server/issues/events{/number}","events_url":"https://api.github.com/repos/toyhammered/hummingbird-server/events","assignees_url":"https://api.github.com/repos/toyhammered/hummingbird-server/assignees{/user}","branches_url":"https://api.github.com/repos/toyhammered/hummingbird-server/branches{/branch}","tags_url":"https://api.github.com/repos/toyhammered/hummingbird-server/tags","blobs_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toyhammered/hummingbird-server/statuses/{sha}","languages_url":"https://api.github.com/repos/toyhammered/hummingbird-server/languages","stargazers_url":"https://api.github.com/repos/toyhammered/hummingbird-server/stargazers","contributors_url":"https://api.github.com/repos/toyhammered/hummingbird-server/contributors","subscribers_url":"https://api.github.com/repos/toyhammered/hummingbird-server/subscribers","subscription_url":"https://api.github.com/repos/toyhammered/hummingbird-server/subscription","commits_url":"https://api.github.com/repos/toyhammered/hummingbird-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/toyhammered/hummingbird-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/toyhammered/hummingbird-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/toyhammered/hummingbird-server/contents/{+path}","compare_url":"https://api.github.com/repos/toyhammered/hummingbird-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toyhammered/hummingbird-server/merges","archive_url":"https://api.github.com/repos/toyhammered/hummingbird-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toyhammered/hummingbird-server/downloads","issues_url":"https://api.github.com/repos/toyhammered/hummingbird-server/issues{/number}","pulls_url":"https://api.github.com/repos/toyhammered/hummingbird-server/pulls{/number}","milestones_url":"https://api.github.com/repos/toyhammered/hummingbird-server/milestones{/number}","notifications_url":"https://api.github.com/repos/toyhammered/hummingbird-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toyhammered/hummingbird-server/labels{/name}","releases_url":"https://api.github.com/repos/toyhammered/hummingbird-server/releases{/id}","deployments_url":"https://api.github.com/repos/toyhammered/hummingbird-server/deployments","created_at":"2016-10-06T04:46:43Z","updated_at":"2016-10-06T04:46:44Z","pushed_at":"2017-02-09T04:45:14Z","git_url":"git://github.com/toyhammered/hummingbird-server.git","ssh_url":"git@github.com:toyhammered/hummingbird-server.git","clone_url":"https://github.com/toyhammered/hummingbird-server.git","svn_url":"https://github.com/toyhammered/hummingbird-server","homepage":null,"size":1995,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"the-future"}},"base":{"label":"hummingbird-me:the-future","ref":"the-future","sha":"0da15b796f8f11935353e975f1d7a1a5a28d4a25","user":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"repo":{"id":68339720,"name":"hummingbird-server","full_name":"hummingbird-me/hummingbird-server","owner":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hummingbird-me/hummingbird-server","description":":steam_locomotive: Rails API server for Kitsu","fork":false,"url":"https://api.github.com/repos/hummingbird-me/hummingbird-server","forks_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/forks","keys_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/teams","hooks_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/hooks","issue_events_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/events{/number}","events_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/events","assignees_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/assignees{/user}","branches_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/branches{/branch}","tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/tags","blobs_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/statuses/{sha}","languages_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/languages","stargazers_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/stargazers","contributors_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/contributors","subscribers_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/subscribers","subscription_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/subscription","commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/contents/{+path}","compare_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/merges","archive_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/downloads","issues_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues{/number}","pulls_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls{/number}","milestones_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/milestones{/number}","notifications_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/labels{/name}","releases_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/releases{/id}","deployments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/deployments","created_at":"2016-09-15T23:36:19Z","updated_at":"2017-02-17T02:10:19Z","pushed_at":"2017-02-16T18:39:37Z","git_url":"git://github.com/hummingbird-me/hummingbird-server.git","ssh_url":"git@github.com:hummingbird-me/hummingbird-server.git","clone_url":"https://github.com/hummingbird-me/hummingbird-server.git","svn_url":"https://github.com/hummingbird-me/hummingbird-server","homepage":"","size":2057,"stargazers_count":29,"watchers_count":29,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":6,"forks":39,"open_issues":6,"watchers":29,"default_branch":"the-future"}},"_links":{"self":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52"},"html":{"href":"https://github.com/hummingbird-me/hummingbird-server/pull/52"},"issue":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/52"},"comments":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/statuses/78804a9aa2cec72737a5a1b701a5b01912bedf38"}}}}
{"actor":{"display_login":"toyhammered"}}