feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.07k stars 752 forks source link

fix(core): Run after all hooks first, and then after method hooks #3004

Closed KidkArolis closed 1 year ago

KidkArolis commented 1 year ago

Summary

Fix #3002 - bring back the "after all" and "after method" hook ordering from V4.

The implementation is not as neat as it was before (having just 1 set of collected hooks was a nice idea). Let me know if you have a better idea.

netlify[bot] commented 1 year ago

Deploy request for feathers-dove rejected.

Name Link
Latest commit f77195596a89cf3e43fe97a9626385569aee120b
daffl commented 1 year ago

Thank you for looking into this. I can't believe we didn't have a test covering that. I was trying a few things to see if there was a different fix but I think this will have to be it for now. The fun and not-so-fun fact here is that a lot of that code is for backwards compatibility for a very specific case which is being able to call service.hooks multiple times.