{"action":"created","issue":{"url":"https://api.github.com/repos/mcollina/bloomrun/issues/18","labels_url":"https://api.github.com/repos/mcollina/bloomrun/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/mcollina/bloomrun/issues/18/comments","events_url":"https://api.github.com/repos/mcollina/bloomrun/issues/18/events","html_url":"https://github.com/mcollina/bloomrun/issues/18","id":117354251,"number":18,"title":"More specific matches loose out to less specific based on order","user":{"login":"mcdonnelldean","id":3625961,"avatar_url":"https://avatars.githubusercontent.com/u/3625961?v=3","gravatar_id":"","url":"https://api.github.com/users/mcdonnelldean","html_url":"https://github.com/mcdonnelldean","followers_url":"https://api.github.com/users/mcdonnelldean/followers","following_url":"https://api.github.com/users/mcdonnelldean/following{/other_user}","gists_url":"https://api.github.com/users/mcdonnelldean/gists{/gist_id}","starred_url":"https://api.github.com/users/mcdonnelldean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcdonnelldean/subscriptions","organizations_url":"https://api.github.com/users/mcdonnelldean/orgs","repos_url":"https://api.github.com/users/mcdonnelldean/repos","events_url":"https://api.github.com/users/mcdonnelldean/events{/privacy}","received_events_url":"https://api.github.com/users/mcdonnelldean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T13:27:27Z","updated_at":"2015-11-17T14:11:21Z","closed_at":null,"body":"See the test below:\r\n\r\n```js\r\n  it('works as expected', function (done) {\r\n    varo.handle({role: 'auth', cmd: 'login'}, function (msg, done) {\r\n      expect(msg).to.deep.equal({role: 'auth', cmd: 'login'})\r\n      return done(null, true)\r\n    })\r\n\r\n    varo.handle({role: 'auth', query: 'isAuthenticated'}, function (msg, done) {\r\n      expect(msg).to.deep.equal({role: 'auth', query: 'isAuthenticated'})\r\n    })\r\n\r\n    varo.act({role: 'auth', cmd: 'login'})\r\n    varo.act({role: 'auth', query: 'isAuthenticated'})\r\n\r\n    done()\r\n  })\r\n```\r\n\r\nThis test is failing because the second act is sent to the first handle. But if I change the code to be\r\n\r\n```js\r\n  it('works as expected', function (done) {\r\n    varo.handle({role: 'auth', cmd: 'login'}, function (msg, done) {\r\n      expect(msg).to.deep.equal({role: 'auth', cmd: 'login'})\r\n      return done(null, true)\r\n    })\r\n\r\n    varo.handle({role: 'auth', cmd: 'isAuthenticated'}, function (msg, done) {\r\n      expect(msg).to.deep.equal({role: 'auth', cmd: 'isAuthenticated'})\r\n    })\r\n\r\n    varo.act({role: 'auth', cmd: 'login'})\r\n    varo.act({role: 'auth', cmd: 'isAuthenticated'})\r\n\r\n    done()\r\n  })\r\n```\r\n\r\nI don't think it's a bug per se, more a side effect. @mcollina Any thoughts on what the next steps are here."},"comment":{"url":"https://api.github.com/repos/mcollina/bloomrun/issues/comments/157380252","html_url":"https://github.com/mcollina/bloomrun/issues/18#issuecomment-157380252","issue_url":"https://api.github.com/repos/mcollina/bloomrun/issues/18","id":157380252,"user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T14:11:21Z","updated_at":"2015-11-17T14:11:21Z","body":"I think that's a bug. The first route should never be matched :).\r\nI'm full for the next couple of days, how about you send a PR?"}}