feathersjs-ecosystem / feathers-hooks-common

Useful hooks for use with FeathersJS services.
https://hooks-common.feathersjs.com
MIT License
193 stars 90 forks source link

fails hooks wrong return with around #709

Open joacub opened 1 year ago

joacub commented 1 year ago

all this hooks fails if you use an around hook, why ? because this lib is modifying the context and feathers don't want that.

this should be avoid :

return {...context, data}

that spread fails as feathers detect the original hook changes

fratzinger commented 1 year ago

feathers-hooks-common currently does not support around hooks, yet.

There's no NextFunction included yet.

joacub commented 1 year ago

That also sir, but now even using in a normal hook, for example the preventChanges hook modify the context so then the feathers complains with a nasty error. Maybe there is other shooks that modify the context so will happen the same error.

fratzinger commented 1 year ago

I've released feathers-hooks-common@7.0.1 with a fix for the regular hook. Please try again with that version and please let me know.

around hooks are on the line and will come in a future release soon.