{"action":"created","issue":{"url":"https://api.github.com/repos/feathersjs/docs/issues/1162","repository_url":"https://api.github.com/repos/feathersjs/docs","labels_url":"https://api.github.com/repos/feathersjs/docs/issues/1162/labels{/name}","comments_url":"https://api.github.com/repos/feathersjs/docs/issues/1162/comments","events_url":"https://api.github.com/repos/feathersjs/docs/issues/1162/events","html_url":"https://github.com/feathersjs/docs/pull/1162","id":332893045,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MjY2MzIz","number":1162,"title":"Why bother with returning & async on hooks","user":{"login":"rayfoss","id":876076,"node_id":"MDQ6VXNlcjg3NjA3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/876076?v=4","gravatar_id":"","url":"https://api.github.com/users/rayfoss","html_url":"https://github.com/rayfoss","followers_url":"https://api.github.com/users/rayfoss/followers","following_url":"https://api.github.com/users/rayfoss/following{/other_user}","gists_url":"https://api.github.com/users/rayfoss/gists{/gist_id}","starred_url":"https://api.github.com/users/rayfoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayfoss/subscriptions","organizations_url":"https://api.github.com/users/rayfoss/orgs","repos_url":"https://api.github.com/users/rayfoss/repos","events_url":"https://api.github.com/users/rayfoss/events{/privacy}","received_events_url":"https://api.github.com/users/rayfoss/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-15T19:42:38Z","updated_at":"2018-06-16T13:53:55Z","closed_at":"2018-06-15T20:24:24Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/feathersjs/docs/pulls/1162","html_url":"https://github.com/feathersjs/docs/pull/1162","diff_url":"https://github.com/feathersjs/docs/pull/1162.diff","patch_url":"https://github.com/feathersjs/docs/pull/1162.patch"},"body":"Why bother with returning and async on hooks? The document is really vague on that. A diverse set of examples is more helpful to show alternatives.\r\n\r\nFurthermore, the async examples should have legitimate async steps to justify them."},"comment":{"url":"https://api.github.com/repos/feathersjs/docs/issues/comments/397813609","html_url":"https://github.com/feathersjs/docs/pull/1162#issuecomment-397813609","issue_url":"https://api.github.com/repos/feathersjs/docs/issues/1162","id":397813609,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzgxMzYwOQ==","user":{"login":"DaddyWarbucks","id":4671808,"node_id":"MDQ6VXNlcjQ2NzE4MDg=","avatar_url":"https://avatars3.githubusercontent.com/u/4671808?v=4","gravatar_id":"","url":"https://api.github.com/users/DaddyWarbucks","html_url":"https://github.com/DaddyWarbucks","followers_url":"https://api.github.com/users/DaddyWarbucks/followers","following_url":"https://api.github.com/users/DaddyWarbucks/following{/other_user}","gists_url":"https://api.github.com/users/DaddyWarbucks/gists{/gist_id}","starred_url":"https://api.github.com/users/DaddyWarbucks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaddyWarbucks/subscriptions","organizations_url":"https://api.github.com/users/DaddyWarbucks/orgs","repos_url":"https://api.github.com/users/DaddyWarbucks/repos","events_url":"https://api.github.com/users/DaddyWarbucks/events{/privacy}","received_events_url":"https://api.github.com/users/DaddyWarbucks/received_events","type":"User","site_admin":false},"created_at":"2018-06-16T13:53:55Z","updated_at":"2018-06-16T13:53:55Z","author_association":"NONE","body":"I feel the same. I had initially deleted my comment, because I wanted to make sure I understood the hook process and how context was passed fully before commenting...but it got posted again from a copy/paste email anyway.\r\n\r\n_If I understand correctly_\r\nWith some more advanced hooks or even when using some helper functions from `feathers-plus`, we can actually run some hooks in parallel. This creates the aforementioned race condition, and is probably a relatively common pattern. This problem is not _totally_ solved by simply returning context, because it is still just a reference and a new \"copy\" is not being handed to the next hook auto-magically. But, if you were to manually ensure immutability and returned a fresh \"copy\" yourself, it is a step in the right direction."}}
{"actor":{"display_login":"DaddyWarbucks"}}