feathers-hooks-common icon indicating copy to clipboard operation
feathers-hooks-common copied to clipboard

fails hooks wrong return with around

Open joacub opened this issue 2 years ago • 4 comments
trafficstars

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

joacub avatar Mar 07 '23 17:03 joacub

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

There's no NextFunction included yet.

fratzinger avatar Mar 08 '23 13:03 fratzinger

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.

joacub avatar Mar 09 '23 06:03 joacub

I've released [email protected] 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.

fratzinger avatar Mar 09 '23 09:03 fratzinger