{"action":"created","issue":{"url":"https://api.github.com/repos/scottwrobinson/camo/issues/57","repository_url":"https://api.github.com/repos/scottwrobinson/camo","labels_url":"https://api.github.com/repos/scottwrobinson/camo/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/scottwrobinson/camo/issues/57/comments","events_url":"https://api.github.com/repos/scottwrobinson/camo/issues/57/events","html_url":"https://github.com/scottwrobinson/camo/issues/57","id":137122055,"number":57,"title":"wrong return value from BaseDocument#_getHookPromises (array of arrays of promise instead of array of promise)","user":{"login":"royaltm","id":615066,"avatar_url":"https://avatars.githubusercontent.com/u/615066?v=3","gravatar_id":"","url":"https://api.github.com/users/royaltm","html_url":"https://github.com/royaltm","followers_url":"https://api.github.com/users/royaltm/followers","following_url":"https://api.github.com/users/royaltm/following{/other_user}","gists_url":"https://api.github.com/users/royaltm/gists{/gist_id}","starred_url":"https://api.github.com/users/royaltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/royaltm/subscriptions","organizations_url":"https://api.github.com/users/royaltm/orgs","repos_url":"https://api.github.com/users/royaltm/repos","events_url":"https://api.github.com/users/royaltm/events{/privacy}","received_events_url":"https://api.github.com/users/royaltm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-29T01:23:00Z","updated_at":"2016-02-29T02:10:27Z","closed_at":null,"body":"Long story short: this really ruined my night: https://github.com/scottwrobinson/camo/blob/b2bd9846234a1fe969e4f8385cdcf7ba66fffc5a/lib/base-document.js#L541\r\n\r\nThe typeless at its worst...\r\n\r\nthis will push an array with (a possible) promise into an array\r\n```\r\nhookPromises.push(_.invoke([this], hookName));\r\n```\r\nresulting in `[[promise]]` instead of `[promise]`\r\n\r\nand this is bad, because\r\n`Promise.all([[promise]])` immediately succeeds.\r\n\r\nSo any error in ANY of this document hook's promise will be (possible silently) discarded!\r\n\r\nwhy just not\r\n\r\n```\r\nhookPromises.push(this[hookName]());\r\n```\r\n\r\nor at least:\r\n\r\n```\r\nhookPromises = hookPromises.concat(_.invoke([this], hookName));\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/scottwrobinson/camo/issues/comments/189996468","html_url":"https://github.com/scottwrobinson/camo/issues/57#issuecomment-189996468","issue_url":"https://api.github.com/repos/scottwrobinson/camo/issues/57","id":189996468,"user":{"login":"scottwrobinson","id":2948719,"avatar_url":"https://avatars.githubusercontent.com/u/2948719?v=3","gravatar_id":"","url":"https://api.github.com/users/scottwrobinson","html_url":"https://github.com/scottwrobinson","followers_url":"https://api.github.com/users/scottwrobinson/followers","following_url":"https://api.github.com/users/scottwrobinson/following{/other_user}","gists_url":"https://api.github.com/users/scottwrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/scottwrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottwrobinson/subscriptions","organizations_url":"https://api.github.com/users/scottwrobinson/orgs","repos_url":"https://api.github.com/users/scottwrobinson/repos","events_url":"https://api.github.com/users/scottwrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/scottwrobinson/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T02:10:27Z","updated_at":"2016-02-29T02:10:27Z","body":"Also, if you can post any code that shows the error that would be great. Thanks!"}}