{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb-server/issues/97","labels_url":"https://api.github.com/repos/pouchdb/pouchdb-server/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb-server/issues/97/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb-server/issues/97/events","html_url":"https://github.com/pouchdb/pouchdb-server/issues/97","id":70892938,"number":97,"title":"continuous changes feed fails if there is an admin account","user":{"login":"gr2m","id":39992,"avatar_url":"https://avatars.githubusercontent.com/u/39992?v=3","gravatar_id":"","url":"https://api.github.com/users/gr2m","html_url":"https://github.com/gr2m","followers_url":"https://api.github.com/users/gr2m/followers","following_url":"https://api.github.com/users/gr2m/following{/other_user}","gists_url":"https://api.github.com/users/gr2m/gists{/gist_id}","starred_url":"https://api.github.com/users/gr2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gr2m/subscriptions","organizations_url":"https://api.github.com/users/gr2m/orgs","repos_url":"https://api.github.com/users/gr2m/repos","events_url":"https://api.github.com/users/gr2m/events{/privacy}","received_events_url":"https://api.github.com/users/gr2m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-25T11:07:01Z","updated_at":"2015-04-25T12:49:16Z","closed_at":null,"body":"I tried to figure out why that is, but had no luck. Here's a test script to reproduce the issue: https://github.com/gr2m/pouchdb-server-continuous-feed-debug\r\n\r\nWould appreciate some help with this <3\r\n\r\n1. Install pouchdb-server: `npm install -g pouchdb-server`\r\n2. Start pouchdb-server: `pouchdb-server -p 5985 --in-memory`\r\n3. open http://localhost:5985/_utils\r\n4. Create database \"test\"\r\n5. Fix admin party, create admin user, username / password don't matter\r\n6. Sign out\r\n7. Open http://localhost:5985/test/_changes?since=0&feed=continuous&heartbeat=30000\r\n8. Boom, you should see\r\n\r\n```\r\nTypeError: Object [object Promise] has no method 'on'\r\n   at changes (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express-pouchdb/lib/routes/changes.js:43:35)\r\n   at Layer.handle [as handle_request] (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/layer.js:82:5)\r\n   at next (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/route.js:100:13)\r\n   at Route.dispatch (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/route.js:81:3)\r\n   at Layer.handle [as handle_request] (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/layer.js:82:5)\r\n   at /pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:235:24\r\n   at param (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:332:14)\r\n   at param (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:348:14)\r\n   at Function.proto.process_params (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:392:3)\r\n   at /pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:229:12\r\n   at Function.match_layer (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:296:3)\r\n   at next (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:190:10)\r\n   at /pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:192:16\r\n   at Function.match_layer (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:296:3)\r\n   at next (/pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:190:10)\r\n   at /pouchdb-server-continuous-feed-debug/node_modules/pouchdb-server/node_modules/express/lib/router/index.js:192:16\r\n```"},"comment":{"url":"https://api.github.com/repos/pouchdb/pouchdb-server/issues/comments/96195386","html_url":"https://github.com/pouchdb/pouchdb-server/issues/97#issuecomment-96195386","issue_url":"https://api.github.com/repos/pouchdb/pouchdb-server/issues/97","id":96195386,"user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2015-04-25T12:49:16Z","updated_at":"2015-04-25T12:49:16Z","body":"@gr2m I don't believe the fix is quite right. If the issue is that we are wrapping something that is supposed to be an `EventEmitter`, then shouldn't all events from the original object be forwarded to the new object? Or it should just extend `EventEmitter`. We've done this a few times, e.g. [here](https://github.com/pouchdb/pouchdb/blob/aef809491d3d19c878132c67ee2f62bf52f58e6a/lib/setup.js#L182-L185) and [here](https://github.com/pouchdb/pouchdb/blob/aef809491d3d19c878132c67ee2f62bf52f58e6a/lib/sync.js#L6-L8)."}}