{"action":"created","issue":{"url":"https://api.github.com/repos/senecajs/seneca-web/issues/52","repository_url":"https://api.github.com/repos/senecajs/seneca-web","labels_url":"https://api.github.com/repos/senecajs/seneca-web/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/senecajs/seneca-web/issues/52/comments","events_url":"https://api.github.com/repos/senecajs/seneca-web/issues/52/events","html_url":"https://github.com/senecajs/seneca-web/issues/52","id":134554929,"number":52,"title":"Seneca/Express unresponsive after first request ","user":{"login":"antjkennedy","id":1441259,"avatar_url":"https://avatars.githubusercontent.com/u/1441259?v=3","gravatar_id":"","url":"https://api.github.com/users/antjkennedy","html_url":"https://github.com/antjkennedy","followers_url":"https://api.github.com/users/antjkennedy/followers","following_url":"https://api.github.com/users/antjkennedy/following{/other_user}","gists_url":"https://api.github.com/users/antjkennedy/gists{/gist_id}","starred_url":"https://api.github.com/users/antjkennedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antjkennedy/subscriptions","organizations_url":"https://api.github.com/users/antjkennedy/orgs","repos_url":"https://api.github.com/users/antjkennedy/repos","events_url":"https://api.github.com/users/antjkennedy/events{/privacy}","received_events_url":"https://api.github.com/users/antjkennedy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/senecajs/seneca-web/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-18T11:28:45Z","updated_at":"2016-02-18T19:18:51Z","closed_at":null,"body":"Hi All,\r\n\r\nI have just encountered a bug when using `express 4.13.4` with `seneca 1.2.0`. Using the quick example found in the [README.md](https://github.com/senecajs/seneca-web/blob/master/README.md) seneca-web will handle the first request, and then ignore subsequent attempts to access the defined routes.\r\n\r\nOnce in this state it looks like seneca is no longer called from the express router. Will update as/when I find out more.\r\n\r\n### log\r\n\r\n```\r\n  express:application set \"x-powered-by\" to true +0ms\r\n  express:application set \"etag\" to 'weak' +3ms\r\n  express:application set \"etag fn\" to [Function: wetag] +0ms\r\n  express:application set \"env\" to 'development' +0ms\r\n  express:application set \"query parser\" to 'extended' +0ms\r\n  express:application set \"query parser fn\" to [Function: parseExtendedQueryString] +0ms\r\n  express:application set \"subdomain offset\" to 2 +1ms\r\n  express:application set \"trust proxy\" to false +0ms\r\n  express:application set \"trust proxy fn\" to [Function: trustNone] +0ms\r\n  express:application booting in development mode +0ms\r\n  express:application set \"view\" to [Function: View] +0ms\r\n  express:application set \"views\" to '/home/vagrant/app/broken/views' +0ms\r\n  express:application set \"jsonp callback name\" to 'callback' +0ms\r\n  express:router use / query +1ms\r\n  express:router:layer new / +0ms\r\n  express:router use / expressInit +0ms\r\n  express:router:layer new / +0ms\r\n  express:router use / <anonymous> +1ms\r\n  express:router:layer new / +0ms\r\n2016-02-18T11:21:59.284Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tIN\te1l39rkpv8s4/lgkoqr7xcyes\tname:basic,plugin:define,role:seneca,seq:1,tag:undefined\t{role:seneca,plugin:define,name:basic,tag:null,seq:1}\tENTRY\t(3xj7c)\t-\t-\tGATE\r\n2016-02-18T11:21:59.295Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\t-       \tOUT\tqe5fg1psxqom/lgkoqr7xcyes\t\t{}\tEXIT\t\t-\t-\t1\t-\r\n2016-02-18T11:21:59.296Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tOUT\te1l39rkpv8s4/lgkoqr7xcyes\tname:basic,plugin:define,role:seneca,seq:1,tag:undefined\tnull\tEXIT\t(3xj7c)\t-\t-\t510\tGATE\r\n2016-02-18T11:21:59.297Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tIN\tus28zktq7xty/7ws14u9x8cia\tname:seneca-jeptg0,plugin:define,role:seneca,seq:2,tag:undefined\t{role:seneca,plugin:define,name:seneca-jeptg0,tag:null,seq:2}\tENTRY\t(7ogju)\t-\t-\tGATE\r\n2016-02-18T11:21:59.298Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\t-       \tOUT\tlyoydgkqsc40/7ws14u9x8cia\t\t{}\tEXIT\t\t-\t-\t0\t-\r\n2016-02-18T11:21:59.298Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tOUT\tus28zktq7xty/7ws14u9x8cia\tname:seneca-jeptg0,plugin:define,role:seneca,seq:2,tag:undefined\tnull\tEXIT\t(7ogju)\t-\t-\t473\tGATE\r\n2016-02-18T11:21:59.299Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tIN\tj8xdsspawo6i/g9k63n5rl84y\tname:seneca-s1vpnz,plugin:define,role:seneca,seq:3,tag:undefined\t{role:seneca,plugin:define,name:seneca-s1vpnz,tag:null,seq:3}\tENTRY\t(patbl)\t-\t-\tGATE\r\n2016-02-18T11:21:59.303Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tmem-store/1\tIN\tc2arqfdqnan5/g9k63n5rl84y\tinit:mem-store\t{init:mem-store,tag:1}\tENTRY\t(67wpr)\t-\t-\t-\r\n2016-02-18T11:21:59.304Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tmem-store/1\tOUT\tc2arqfdqnan5/g9k63n5rl84y\tinit:mem-store\tnull\tEXIT\t(67wpr)\t-\t-\t1\t-\r\n2016-02-18T11:21:59.304Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tOUT\tj8xdsspawo6i/g9k63n5rl84y\tname:seneca-s1vpnz,plugin:define,role:seneca,seq:3,tag:undefined\tnull\tEXIT\t(patbl)\t-\t-\t450\tGATE\r\n2016-02-18T11:21:59.304Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tIN\tnubnx5j0hscm/kc3yitqi9v0r\tname:seneca-ln545z,plugin:define,role:seneca,seq:4,tag:undefined\t{role:seneca,plugin:define,name:seneca-ln545z,tag:null,seq:4}\tENTRY\t(j3n1j)\t-\t-\tGATE\r\n2016-02-18T11:21:59.314Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\t-       \tOUT\t317z3lpaeysx/kc3yitqi9v0r\t\t{}\tEXIT\t\t-\t-\t0\t-\r\n2016-02-18T11:21:59.315Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tOUT\tnubnx5j0hscm/kc3yitqi9v0r\tname:seneca-ln545z,plugin:define,role:seneca,seq:4,tag:undefined\tnull\tEXIT\t(j3n1j)\t-\t-\t301\tGATE\r\n2016-02-18T11:21:59.315Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tIN\tbupgk7xmt53f/wescvsw9g7ya\tname:seneca-77ny1f,plugin:define,role:seneca,seq:5,tag:undefined\t{role:seneca,plugin:define,name:seneca-77ny1f,tag:null,seq:5}\tENTRY\t(18vrt)\t-\t-\tGATE\r\n2016-02-18T11:21:59.338Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tIN\ti1epi29yw946/wescvsw9g7ya\tinit:web\t{init:web,tag:null}\tENTRY\t(d8640)\t-\t-\t-\r\n2016-02-18T11:21:59.338Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tOUT\ti1epi29yw946/wescvsw9g7ya\tinit:web\tnull\tEXIT\t(d8640)\t-\t-\t1\t-\r\n2016-02-18T11:21:59.338Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tOUT\tbupgk7xmt53f/wescvsw9g7ya\tname:seneca-77ny1f,plugin:define,role:seneca,seq:5,tag:undefined\tnull\tEXIT\t(18vrt)\t-\t-\t190\tGATE\r\n2016-02-18T11:21:59.339Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tIN\t3c6b1u01m1p8/wescvsw9g7ya\trole:web\t{role:web,plugin:web,config:{prefix:/seneca}}\tENTRY\t(axg33)\t-\t-\t-\r\n2016-02-18T11:21:59.340Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tOUT\t3c6b1u01m1p8/wescvsw9g7ya\trole:web\tnull\tEXIT\t(axg33)\t-\t-\t2\t-\r\n2016-02-18T11:21:59.340Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tbasic       \tIN\t7k2kiug8wu38/wescvsw9g7ya\tcmd:push,note:true,role:basic\t{role:basic,note:true,cmd:push,key:admin/units,value:{unit:web-service,spec:{title:Web Services,ng:{}},content:\tENTRY\t(3g0nx)\t-\t-\t-\r\n2016-02-18T11:21:59.340Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tbasic       \tOUT\t7k2kiug8wu38/wescvsw9g7ya\tcmd:push,note:true,role:basic\tnull\tEXIT\t(3g0nx)\t-\t-\t2\t-\r\n2016-02-18T11:21:59.341Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tIN\twgdvfva4y8h2/jypxfbnghncj\trole:web\t{use:{prefix:/my-api,pin:{role:api,cmd:*},map:{zig:true,bar:{},qaz:{}}},role:web}\tENTRY\t(axg33)\t-\t-\t-\r\n2016-02-18T11:21:59.341Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tOUT\twgdvfva4y8h2/jypxfbnghncj\trole:web\tnull\tEXIT\t(axg33)\t-\t-\t189\t-\r\n  express:router dispatching GET /my-api/bar?zoo=5 +11s\r\n  express:router query  : /my-api/bar?zoo=5 +1ms\r\n  express:router expressInit  : /my-api/bar?zoo=5 +2ms\r\n  express:router <anonymous>  : /my-api/bar?zoo=5 +0ms\r\n2016-02-18T11:22:10.624Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\tweb       \tOUT\twgdvfva4y8h2/jypxfbnghncj\trole:web\tnull\tEXIT\t(axg33)\t-\t-\t11469\t-\r\n2016-02-18T11:22:10.628Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tIN\to0z96f965ui6/rz8hni9fnnjq\tcmd:bar,role:api\t{cmd:bar,role:api,zoo:5,did:(7hx9w),fixedargs:{},context:{}}\tENTRY\t(vlry7)\t-\t-\t-\r\n2016-02-18T11:22:10.629Z 6r2lg1duvl0j/1455794518666/4871/undefined DEBUG\tact\troot$       \tOUT\to0z96f965ui6/rz8hni9fnnjq\tcmd:bar,role:api\t{bar:5b}\tEXIT\t(vlry7)\t-\t-\t2\t-\r\n  express:router dispatching GET /my-api/bar?zoo=5 +2s\r\n  express:router query  : /my-api/bar?zoo=5 +0ms\r\n  express:router expressInit  : /my-api/bar?zoo=5 +1ms\r\n  express:router <anonymous>  : /my-api/bar?zoo=5 +0ms\r\n```\r\n\r\n### example.js\r\n\r\n```javascript\r\nvar seneca = require('seneca')()\r\n\r\n\r\nseneca.add('role:api,cmd:zig',function(args,done){\r\n  done(null,{bar:args.zoo+'g'})\r\n})\r\n\r\nseneca.add('role:api,cmd:bar',function(args,done){\r\n  done(null,{bar:args.zoo+'b'})\r\n})\r\n\r\nseneca.add('role:api,cmd:qaz',function(args,done){\r\n  done(null,{qaz:args.zoo+'z'})\r\n})\r\n\r\n\r\nseneca.act('role:web',{use:{\r\n  \r\n  // define some routes that start with /my-api\r\n  prefix: '/my-api',\r\n\r\n  // use action patterns where role has the value 'api' and cmd has some defined value\r\n  pin: {role:'api',cmd:'*'},\r\n\r\n  // for each value of cmd, match some HTTP method, and use the\r\n  // query parameters as values for the action\r\n  map:{\r\n    zig: true,                // GET is the default\r\n    bar: {GET:true},          // explicitly accepting GETs\r\n    qaz: {GET:true,POST:true} // accepting both GETs and POSTs\r\n  }\r\n}})\r\n\r\nvar express = require('express')\r\nvar app = express()\r\n\r\n\r\n// This is how you integrate Seneca with Express\r\napp.use( seneca.export('web') )\r\n\r\napp.listen(3000)\r\n```\r\n\r\n### package.json\r\n\r\n```json\r\n{\r\n  \"name\": \"express-seneca-web\",\r\n  \"version\": \"0.0.0\",\r\n  \"description\": \"example of broken seneca/express routing\",\r\n  \"main\": \"main.js\",\r\n  \"scripts\": {\r\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\r\n  },\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\",\r\n  \"dependencies\": {\r\n    \"express\": \"^4.13.4\",\r\n    \"seneca\": \"^1.2.0\"\r\n  }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/senecajs/seneca-web/issues/comments/185871819","html_url":"https://github.com/senecajs/seneca-web/issues/52#issuecomment-185871819","issue_url":"https://api.github.com/repos/senecajs/seneca-web/issues/52","id":185871819,"user":{"login":"geek","id":441346,"avatar_url":"https://avatars.githubusercontent.com/u/441346?v=3","gravatar_id":"","url":"https://api.github.com/users/geek","html_url":"https://github.com/geek","followers_url":"https://api.github.com/users/geek/followers","following_url":"https://api.github.com/users/geek/following{/other_user}","gists_url":"https://api.github.com/users/geek/gists{/gist_id}","starred_url":"https://api.github.com/users/geek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geek/subscriptions","organizations_url":"https://api.github.com/users/geek/orgs","repos_url":"https://api.github.com/users/geek/repos","events_url":"https://api.github.com/users/geek/events{/privacy}","received_events_url":"https://api.github.com/users/geek/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T19:18:51Z","updated_at":"2016-02-18T19:18:51Z","body":"@antjkennedy seneca-web 0.7.1 is now published with that fix... feel free to point to that in your package"}}