{"action":"opened","number":80,"pull_request":{"url":"https://api.github.com/repos/scttnlsn/monq/pulls/80","id":93570740,"html_url":"https://github.com/scttnlsn/monq/pull/80","diff_url":"https://github.com/scttnlsn/monq/pull/80.diff","patch_url":"https://github.com/scttnlsn/monq/pull/80.patch","issue_url":"https://api.github.com/repos/scttnlsn/monq/issues/80","number":80,"state":"open","locked":false,"title":"Connection.worker options not safe","user":{"login":"ggn06awu","id":2786837,"avatar_url":"https://avatars.githubusercontent.com/u/2786837?v=3","gravatar_id":"","url":"https://api.github.com/users/ggn06awu","html_url":"https://github.com/ggn06awu","followers_url":"https://api.github.com/users/ggn06awu/followers","following_url":"https://api.github.com/users/ggn06awu/following{/other_user}","gists_url":"https://api.github.com/users/ggn06awu/gists{/gist_id}","starred_url":"https://api.github.com/users/ggn06awu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggn06awu/subscriptions","organizations_url":"https://api.github.com/users/ggn06awu/orgs","repos_url":"https://api.github.com/users/ggn06awu/repos","events_url":"https://api.github.com/users/ggn06awu/events{/privacy}","received_events_url":"https://api.github.com/users/ggn06awu/received_events","type":"User","site_admin":false},"body":"I've been working with another library consuming this library, and found they've not provided an empty object in the options for Connection.worker, resulting in an exception. As the options parameter is not mandatory in this function, suggesting we default an empty object here. Error I've encountered:\r\n\r\n<pre><code>\r\n   [ 'TypeError: Cannot read property \\'collection\\' of undefined',\r\n     '    at Connection.worker (/home/mark/WebstormProjects/micro-stock-service/src/node_modules/monq/lib/connection.js:35:36)',\r\n     '    at workers.forEach.job (/home/mark/WebstormProjects/micro-stock-service/src/node_modules/microbase/modules/workers/index.js:23:25)',\r\n     '    at Array.forEach (native)',\r\n     '    at workers (/home/mark/WebstormProjects/micro-stock-service/src/node_modules/microbase/modules/workers/index.js:19:11)',\r\n     '    at module.exports (/home/mark/WebstormProjects/micro-stock-service/src/node_modules/microbase/index.js:65:65)',\r\n     '    at Object.<anonymous> (/home/mark/WebstormProjects/micro-stock-service/src/index.js:1:96)',\r\n     '    at Module._compile (module.js:541:32)',\r\n     '    at Object.Module._extensions..js (module.js:550:10)',\r\n     '    at Module.load (module.js:458:32)',\r\n     '    at tryModuleLoad (module.js:417:12)',\r\n     '    at Function.Module._load (module.js:409:3)',\r\n     '    at Module.runMain (module.js:575:10)',\r\n     '    at run (bootstrap_node.js:352:7)',\r\n     '    at startup (bootstrap_node.js:144:9)',\r\n     '    at bootstrap_node.js:467:3' ]\r\n</code></pre>","created_at":"2016-11-14T13:58:54Z","updated_at":"2016-11-14T13:58:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scttnlsn/monq/pulls/80/commits","review_comments_url":"https://api.github.com/repos/scttnlsn/monq/pulls/80/comments","review_comment_url":"https://api.github.com/repos/scttnlsn/monq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scttnlsn/monq/issues/80/comments","statuses_url":"https://api.github.com/repos/scttnlsn/monq/statuses/e5e025ae429ca64c5056c90b7eb8b3f78b212ca6","head":{"label":"ggn06awu:patch-1","ref":"patch-1","sha":"e5e025ae429ca64c5056c90b7eb8b3f78b212ca6","user":{"login":"ggn06awu","id":2786837,"avatar_url":"https://avatars.githubusercontent.com/u/2786837?v=3","gravatar_id":"","url":"https://api.github.com/users/ggn06awu","html_url":"https://github.com/ggn06awu","followers_url":"https://api.github.com/users/ggn06awu/followers","following_url":"https://api.github.com/users/ggn06awu/following{/other_user}","gists_url":"https://api.github.com/users/ggn06awu/gists{/gist_id}","starred_url":"https://api.github.com/users/ggn06awu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggn06awu/subscriptions","organizations_url":"https://api.github.com/users/ggn06awu/orgs","repos_url":"https://api.github.com/users/ggn06awu/repos","events_url":"https://api.github.com/users/ggn06awu/events{/privacy}","received_events_url":"https://api.github.com/users/ggn06awu/received_events","type":"User","site_admin":false},"repo":{"id":73709447,"name":"monq","full_name":"ggn06awu/monq","owner":{"login":"ggn06awu","id":2786837,"avatar_url":"https://avatars.githubusercontent.com/u/2786837?v=3","gravatar_id":"","url":"https://api.github.com/users/ggn06awu","html_url":"https://github.com/ggn06awu","followers_url":"https://api.github.com/users/ggn06awu/followers","following_url":"https://api.github.com/users/ggn06awu/following{/other_user}","gists_url":"https://api.github.com/users/ggn06awu/gists{/gist_id}","starred_url":"https://api.github.com/users/ggn06awu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggn06awu/subscriptions","organizations_url":"https://api.github.com/users/ggn06awu/orgs","repos_url":"https://api.github.com/users/ggn06awu/repos","events_url":"https://api.github.com/users/ggn06awu/events{/privacy}","received_events_url":"https://api.github.com/users/ggn06awu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ggn06awu/monq","description":"MongoDB-backed job queue for Node.js","fork":true,"url":"https://api.github.com/repos/ggn06awu/monq","forks_url":"https://api.github.com/repos/ggn06awu/monq/forks","keys_url":"https://api.github.com/repos/ggn06awu/monq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ggn06awu/monq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ggn06awu/monq/teams","hooks_url":"https://api.github.com/repos/ggn06awu/monq/hooks","issue_events_url":"https://api.github.com/repos/ggn06awu/monq/issues/events{/number}","events_url":"https://api.github.com/repos/ggn06awu/monq/events","assignees_url":"https://api.github.com/repos/ggn06awu/monq/assignees{/user}","branches_url":"https://api.github.com/repos/ggn06awu/monq/branches{/branch}","tags_url":"https://api.github.com/repos/ggn06awu/monq/tags","blobs_url":"https://api.github.com/repos/ggn06awu/monq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ggn06awu/monq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ggn06awu/monq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ggn06awu/monq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ggn06awu/monq/statuses/{sha}","languages_url":"https://api.github.com/repos/ggn06awu/monq/languages","stargazers_url":"https://api.github.com/repos/ggn06awu/monq/stargazers","contributors_url":"https://api.github.com/repos/ggn06awu/monq/contributors","subscribers_url":"https://api.github.com/repos/ggn06awu/monq/subscribers","subscription_url":"https://api.github.com/repos/ggn06awu/monq/subscription","commits_url":"https://api.github.com/repos/ggn06awu/monq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ggn06awu/monq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ggn06awu/monq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ggn06awu/monq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ggn06awu/monq/contents/{+path}","compare_url":"https://api.github.com/repos/ggn06awu/monq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ggn06awu/monq/merges","archive_url":"https://api.github.com/repos/ggn06awu/monq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ggn06awu/monq/downloads","issues_url":"https://api.github.com/repos/ggn06awu/monq/issues{/number}","pulls_url":"https://api.github.com/repos/ggn06awu/monq/pulls{/number}","milestones_url":"https://api.github.com/repos/ggn06awu/monq/milestones{/number}","notifications_url":"https://api.github.com/repos/ggn06awu/monq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ggn06awu/monq/labels{/name}","releases_url":"https://api.github.com/repos/ggn06awu/monq/releases{/id}","deployments_url":"https://api.github.com/repos/ggn06awu/monq/deployments","created_at":"2016-11-14T13:53:38Z","updated_at":"2016-11-14T13:53:39Z","pushed_at":"2016-11-14T13:58:44Z","git_url":"git://github.com/ggn06awu/monq.git","ssh_url":"git@github.com:ggn06awu/monq.git","clone_url":"https://github.com/ggn06awu/monq.git","svn_url":"https://github.com/ggn06awu/monq","homepage":"","size":139,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scttnlsn:master","ref":"master","sha":"d8790503efa72f9754fe9a7110b28cb3c3c1ff02","user":{"login":"scttnlsn","id":578446,"avatar_url":"https://avatars.githubusercontent.com/u/578446?v=3","gravatar_id":"","url":"https://api.github.com/users/scttnlsn","html_url":"https://github.com/scttnlsn","followers_url":"https://api.github.com/users/scttnlsn/followers","following_url":"https://api.github.com/users/scttnlsn/following{/other_user}","gists_url":"https://api.github.com/users/scttnlsn/gists{/gist_id}","starred_url":"https://api.github.com/users/scttnlsn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scttnlsn/subscriptions","organizations_url":"https://api.github.com/users/scttnlsn/orgs","repos_url":"https://api.github.com/users/scttnlsn/repos","events_url":"https://api.github.com/users/scttnlsn/events{/privacy}","received_events_url":"https://api.github.com/users/scttnlsn/received_events","type":"User","site_admin":false},"repo":{"id":5113199,"name":"monq","full_name":"scttnlsn/monq","owner":{"login":"scttnlsn","id":578446,"avatar_url":"https://avatars.githubusercontent.com/u/578446?v=3","gravatar_id":"","url":"https://api.github.com/users/scttnlsn","html_url":"https://github.com/scttnlsn","followers_url":"https://api.github.com/users/scttnlsn/followers","following_url":"https://api.github.com/users/scttnlsn/following{/other_user}","gists_url":"https://api.github.com/users/scttnlsn/gists{/gist_id}","starred_url":"https://api.github.com/users/scttnlsn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scttnlsn/subscriptions","organizations_url":"https://api.github.com/users/scttnlsn/orgs","repos_url":"https://api.github.com/users/scttnlsn/repos","events_url":"https://api.github.com/users/scttnlsn/events{/privacy}","received_events_url":"https://api.github.com/users/scttnlsn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scttnlsn/monq","description":"MongoDB-backed job queue for Node.js","fork":false,"url":"https://api.github.com/repos/scttnlsn/monq","forks_url":"https://api.github.com/repos/scttnlsn/monq/forks","keys_url":"https://api.github.com/repos/scttnlsn/monq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scttnlsn/monq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scttnlsn/monq/teams","hooks_url":"https://api.github.com/repos/scttnlsn/monq/hooks","issue_events_url":"https://api.github.com/repos/scttnlsn/monq/issues/events{/number}","events_url":"https://api.github.com/repos/scttnlsn/monq/events","assignees_url":"https://api.github.com/repos/scttnlsn/monq/assignees{/user}","branches_url":"https://api.github.com/repos/scttnlsn/monq/branches{/branch}","tags_url":"https://api.github.com/repos/scttnlsn/monq/tags","blobs_url":"https://api.github.com/repos/scttnlsn/monq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scttnlsn/monq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scttnlsn/monq/git/refs{/sha}","trees_url":"https://api.github.com/repos/scttnlsn/monq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scttnlsn/monq/statuses/{sha}","languages_url":"https://api.github.com/repos/scttnlsn/monq/languages","stargazers_url":"https://api.github.com/repos/scttnlsn/monq/stargazers","contributors_url":"https://api.github.com/repos/scttnlsn/monq/contributors","subscribers_url":"https://api.github.com/repos/scttnlsn/monq/subscribers","subscription_url":"https://api.github.com/repos/scttnlsn/monq/subscription","commits_url":"https://api.github.com/repos/scttnlsn/monq/commits{/sha}","git_commits_url":"https://api.github.com/repos/scttnlsn/monq/git/commits{/sha}","comments_url":"https://api.github.com/repos/scttnlsn/monq/comments{/number}","issue_comment_url":"https://api.github.com/repos/scttnlsn/monq/issues/comments{/number}","contents_url":"https://api.github.com/repos/scttnlsn/monq/contents/{+path}","compare_url":"https://api.github.com/repos/scttnlsn/monq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scttnlsn/monq/merges","archive_url":"https://api.github.com/repos/scttnlsn/monq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scttnlsn/monq/downloads","issues_url":"https://api.github.com/repos/scttnlsn/monq/issues{/number}","pulls_url":"https://api.github.com/repos/scttnlsn/monq/pulls{/number}","milestones_url":"https://api.github.com/repos/scttnlsn/monq/milestones{/number}","notifications_url":"https://api.github.com/repos/scttnlsn/monq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scttnlsn/monq/labels{/name}","releases_url":"https://api.github.com/repos/scttnlsn/monq/releases{/id}","deployments_url":"https://api.github.com/repos/scttnlsn/monq/deployments","created_at":"2012-07-19T17:35:13Z","updated_at":"2016-11-14T10:23:08Z","pushed_at":"2016-11-11T15:33:31Z","git_url":"git://github.com/scttnlsn/monq.git","ssh_url":"git@github.com:scttnlsn/monq.git","clone_url":"https://github.com/scttnlsn/monq.git","svn_url":"https://github.com/scttnlsn/monq","homepage":"","size":139,"stargazers_count":145,"watchers_count":145,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":12,"forks":45,"open_issues":12,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scttnlsn/monq/pulls/80"},"html":{"href":"https://github.com/scttnlsn/monq/pull/80"},"issue":{"href":"https://api.github.com/repos/scttnlsn/monq/issues/80"},"comments":{"href":"https://api.github.com/repos/scttnlsn/monq/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/scttnlsn/monq/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/scttnlsn/monq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scttnlsn/monq/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/scttnlsn/monq/statuses/e5e025ae429ca64c5056c90b7eb8b3f78b212ca6"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"ggn06awu"}}