{"action":"created","issue":{"url":"https://api.github.com/repos/edwardhotchkiss/short/issues/33","labels_url":"https://api.github.com/repos/edwardhotchkiss/short/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/edwardhotchkiss/short/issues/33/comments","events_url":"https://api.github.com/repos/edwardhotchkiss/short/issues/33/events","html_url":"https://github.com/edwardhotchkiss/short/pull/33","id":104903229,"number":33,"title":"Only connects if current state is disconnected","user":{"login":"jperkelens","id":176702,"avatar_url":"https://avatars.githubusercontent.com/u/176702?v=3","gravatar_id":"","url":"https://api.github.com/users/jperkelens","html_url":"https://github.com/jperkelens","followers_url":"https://api.github.com/users/jperkelens/followers","following_url":"https://api.github.com/users/jperkelens/following{/other_user}","gists_url":"https://api.github.com/users/jperkelens/gists{/gist_id}","starred_url":"https://api.github.com/users/jperkelens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jperkelens/subscriptions","organizations_url":"https://api.github.com/users/jperkelens/orgs","repos_url":"https://api.github.com/users/jperkelens/repos","events_url":"https://api.github.com/users/jperkelens/events{/privacy}","received_events_url":"https://api.github.com/users/jperkelens/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-04T14:40:41Z","updated_at":"2015-09-04T17:41:27Z","closed_at":"2015-09-04T15:54:16Z","pull_request":{"url":"https://api.github.com/repos/edwardhotchkiss/short/pulls/33","html_url":"https://github.com/edwardhotchkiss/short/pull/33","diff_url":"https://github.com/edwardhotchkiss/short/pull/33.diff","patch_url":"https://github.com/edwardhotchkiss/short/pull/33.patch"},"body":"I found a bit of weird edge case, and wanted to call it to your attention. In the latest version, it seems if you are depending on short and the same version of mongoose that short uses, short and its dependent program will share the mongoose instance. \r\n\r\nThe consequences of this are that if mongoose.connect is called before short.connect a \"Error: Trying to open unclosed connection.\" is thrown. The solution to this would be to check mongoose's connection readyState to make sure it is disconnected before calling connect.\r\n\r\nHowever I am not able to reproduce this issue in a linked version of the short dependency. I believe that b/c of how npm handles dependencies, if you are working with a local copy you get two instances of mongoose. So, I can't be sure this resolves the issue and I can only reproduce it with npm installed versions of the dependency. I understand hesitancy to pull in based on an unproven fix, but not sure what else to do other than pushing up a clone project to npm to try to reproduce. Let me know how you'd like to handle it.\r\n\r\nThis MIGHT be an environment quirk on my end: \r\nIm running node v0.10.35, npm 1.4.28, OS X 10.10.3 "},"comment":{"url":"https://api.github.com/repos/edwardhotchkiss/short/issues/comments/137802333","html_url":"https://github.com/edwardhotchkiss/short/pull/33#issuecomment-137802333","issue_url":"https://api.github.com/repos/edwardhotchkiss/short/issues/33","id":137802333,"user":{"login":"edwardhotchkiss","id":755709,"avatar_url":"https://avatars.githubusercontent.com/u/755709?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardhotchkiss","html_url":"https://github.com/edwardhotchkiss","followers_url":"https://api.github.com/users/edwardhotchkiss/followers","following_url":"https://api.github.com/users/edwardhotchkiss/following{/other_user}","gists_url":"https://api.github.com/users/edwardhotchkiss/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardhotchkiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardhotchkiss/subscriptions","organizations_url":"https://api.github.com/users/edwardhotchkiss/orgs","repos_url":"https://api.github.com/users/edwardhotchkiss/repos","events_url":"https://api.github.com/users/edwardhotchkiss/events{/privacy}","received_events_url":"https://api.github.com/users/edwardhotchkiss/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T17:41:27Z","updated_at":"2015-09-04T17:41:27Z","body":"Published :calling: "}}