Skip to content

fails hooks wrong return with around #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
joacub opened this issue Mar 7, 2023 · 4 comments · May be fixed by #764
Open

fails hooks wrong return with around #709

joacub opened this issue Mar 7, 2023 · 4 comments · May be fixed by #764

Comments

@joacub
Copy link

joacub commented Mar 7, 2023

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
Copy link
Collaborator

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

There's no NextFunction included yet.

@joacub
Copy link
Author

joacub commented Mar 9, 2023

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
Copy link
Collaborator

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.

anthonymunene added a commit to anthonymunene/reservation-apps that referenced this issue May 2, 2023
doesnt look like this hook works with the around hook
see :feathersjs-ecosystem/feathers-hooks-common#709
@fratzinger
Copy link
Collaborator

Just a quick headsup. I started working on a massive rewrite of the package (#764). It's not released yet and will take a few weeks.

This should be working then.

@fratzinger fratzinger linked a pull request Feb 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants