{"action":"created","issue":{"url":"https://api.github.com/repos/fastify/fastify/issues/867","repository_url":"https://api.github.com/repos/fastify/fastify","labels_url":"https://api.github.com/repos/fastify/fastify/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/fastify/fastify/issues/867/comments","events_url":"https://api.github.com/repos/fastify/fastify/issues/867/events","html_url":"https://github.com/fastify/fastify/issues/867","id":310082090,"number":867,"title":"Second 'close' listener receive fastify instance","user":{"login":"StarpTech","id":1764424,"avatar_url":"https://avatars2.githubusercontent.com/u/1764424?v=4","gravatar_id":"","url":"https://api.github.com/users/StarpTech","html_url":"https://github.com/StarpTech","followers_url":"https://api.github.com/users/StarpTech/followers","following_url":"https://api.github.com/users/StarpTech/following{/other_user}","gists_url":"https://api.github.com/users/StarpTech/gists{/gist_id}","starred_url":"https://api.github.com/users/StarpTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StarpTech/subscriptions","organizations_url":"https://api.github.com/users/StarpTech/orgs","repos_url":"https://api.github.com/users/StarpTech/repos","events_url":"https://api.github.com/users/StarpTech/events{/privacy}","received_events_url":"https://api.github.com/users/StarpTech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-03-30T14:38:38Z","updated_at":"2018-03-31T09:44:11Z","closed_at":null,"author_association":"MEMBER","body":"As titled. For me, it feels like a bug. I think this is the case https://github.com/mcollina/avvio/blob/master/boot.js#L317\r\nI expect that both functions have the same interface.\r\n\r\n```js\r\n'use strict'\r\n\r\nconst fastify = require('../fastify')()\r\n\r\nfastify\r\n  .get('/', function (req, reply) {\r\n    reply\r\n      .send({ hello: 'world' })\r\n  })\r\n\r\nfastify.listen(3000, err => {\r\n  if (err) throw err\r\n  console.log(`server listening on ${fastify.server.address().port}`)\r\n\r\n  fastify.close((err) => {\r\n    console.log('close 1')\r\n    console.log(err instanceof fastify.constructor)\r\n  })\r\n  fastify.close((err) => {\r\n    console.log('close 2')\r\n    console.log(err instanceof fastify.constructor)\r\n  })\r\n})\r\n\r\n/*\r\nserver listening on 3000\r\nclose 1\r\ntrue\r\nclose 2\r\nfalse\r\n*/\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fastify/fastify/issues/comments/377680683","html_url":"https://github.com/fastify/fastify/issues/867#issuecomment-377680683","issue_url":"https://api.github.com/repos/fastify/fastify/issues/867","id":377680683,"user":{"login":"StarpTech","id":1764424,"avatar_url":"https://avatars2.githubusercontent.com/u/1764424?v=4","gravatar_id":"","url":"https://api.github.com/users/StarpTech","html_url":"https://github.com/StarpTech","followers_url":"https://api.github.com/users/StarpTech/followers","following_url":"https://api.github.com/users/StarpTech/following{/other_user}","gists_url":"https://api.github.com/users/StarpTech/gists{/gist_id}","starred_url":"https://api.github.com/users/StarpTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StarpTech/subscriptions","organizations_url":"https://api.github.com/users/StarpTech/orgs","repos_url":"https://api.github.com/users/StarpTech/repos","events_url":"https://api.github.com/users/StarpTech/events{/privacy}","received_events_url":"https://api.github.com/users/StarpTech/received_events","type":"User","site_admin":false},"created_at":"2018-03-31T09:44:11Z","updated_at":"2018-03-31T09:44:11Z","author_association":"MEMBER","body":"> What is your point? Fastify uses avvio, it isn't based upon it per se. In Fastify sending multiple .close() calls is wrong.\r\n\r\n@jsumners a `close` handler is just an `onClose` hook with the difference that the **close** routine is triggered and some parameters differ. That's why it's legitimate."}}
{"actor":{"display_login":"StarpTech"}}