{"action":"opened","number":184,"pull_request":{"url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/184","id":240231904,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMjMxOTA0","html_url":"https://github.com/ipfs/js-ipfs-bitswap/pull/184","diff_url":"https://github.com/ipfs/js-ipfs-bitswap/pull/184.diff","patch_url":"https://github.com/ipfs/js-ipfs-bitswap/pull/184.patch","issue_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/184","number":184,"state":"open","locked":false,"title":"avoid running sync code in asynchronously","user":{"login":"jacobheun","id":639834,"node_id":"MDQ6VXNlcjYzOTgzNA==","avatar_url":"https://avatars3.githubusercontent.com/u/639834?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobheun","html_url":"https://github.com/jacobheun","followers_url":"https://api.github.com/users/jacobheun/followers","following_url":"https://api.github.com/users/jacobheun/following{/other_user}","gists_url":"https://api.github.com/users/jacobheun/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobheun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobheun/subscriptions","organizations_url":"https://api.github.com/users/jacobheun/orgs","repos_url":"https://api.github.com/users/jacobheun/repos","events_url":"https://api.github.com/users/jacobheun/events{/privacy}","received_events_url":"https://api.github.com/users/jacobheun/received_events","type":"User","site_admin":false},"body":"This PR refactors some of the bitswap code to prevent it from running synchronous code asynchronously, which can bloat the call stack and in severe cases contribute to stack overflows. \r\n\r\nThis also changes usage of setImmediate to use nextTick instead, as there is a performance boost there.\r\n\r\nAlso:\r\n* Fixed an issue where the want manager tests could call done multiple times\r\n* The decision engine had a waterfall callback that was never being called, that's been fixed. \r\n\r\n\r\nRelates to https://github.com/libp2p/js-libp2p-switch/issues/287","created_at":"2018-12-20T16:37:10Z","updated_at":"2018-12-20T16:37:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/184/commits","review_comments_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/184/comments","review_comment_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/184/comments","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/statuses/559cdb4bb0965e07c09885ec65c1ebdec8e790c1","head":{"label":"ipfs:fix/async","ref":"fix/async","sha":"559cdb4bb0965e07c09885ec65c1ebdec8e790c1","user":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":42387001,"node_id":"MDEwOlJlcG9zaXRvcnk0MjM4NzAwMQ==","name":"js-ipfs-bitswap","full_name":"ipfs/js-ipfs-bitswap","private":false,"owner":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ipfs/js-ipfs-bitswap","description":"JavaScript implementation of Bitswap 'data exchange' protocol used by IPFS","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap","forks_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/deployments","created_at":"2015-09-13T07:07:29Z","updated_at":"2018-12-09T15:18:10Z","pushed_at":"2018-12-20T16:31:40Z","git_url":"git://github.com/ipfs/js-ipfs-bitswap.git","ssh_url":"git@github.com:ipfs/js-ipfs-bitswap.git","clone_url":"https://github.com/ipfs/js-ipfs-bitswap.git","svn_url":"https://github.com/ipfs/js-ipfs-bitswap","homepage":"","size":432,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":19,"open_issues":13,"watchers":27,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"399dc0ed09a36dae6c5df741eb59cc9026b2c473","user":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":42387001,"node_id":"MDEwOlJlcG9zaXRvcnk0MjM4NzAwMQ==","name":"js-ipfs-bitswap","full_name":"ipfs/js-ipfs-bitswap","private":false,"owner":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ipfs/js-ipfs-bitswap","description":"JavaScript implementation of Bitswap 'data exchange' protocol used by IPFS","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap","forks_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/deployments","created_at":"2015-09-13T07:07:29Z","updated_at":"2018-12-09T15:18:10Z","pushed_at":"2018-12-20T16:31:40Z","git_url":"git://github.com/ipfs/js-ipfs-bitswap.git","ssh_url":"git@github.com:ipfs/js-ipfs-bitswap.git","clone_url":"https://github.com/ipfs/js-ipfs-bitswap.git","svn_url":"https://github.com/ipfs/js-ipfs-bitswap","homepage":"","size":432,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":19,"open_issues":13,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/184"},"html":{"href":"https://github.com/ipfs/js-ipfs-bitswap/pull/184"},"issue":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/184"},"comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/issues/184/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/184/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/pulls/184/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/js-ipfs-bitswap/statuses/559cdb4bb0965e07c09885ec65c1ebdec8e790c1"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":8,"additions":36,"deletions":36,"changed_files":10}}
{"actor":{"display_login":"jacobheun"}}