-
-
Notifications
You must be signed in to change notification settings - Fork 752
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
[Suggestion] Ability to disable default service events from being emitted #922
Comments
Related to #862 but you can already return feathers.SKIP in your last hook which will skip sending events (which is just another hook, too). |
I see, I wasn't aware that the event emission was triggered as the last hook of the chain. However - I'm not sure this is a suitable solution for us because this would also skip any other application-level after/finally hooks that exist, not just the one which emits events. Please correct me if this is not the case! |
Yes, the best way would be to allow to skip it explicitly as in #862. We could also add a flag that is used by |
I can confirm the issue with a service creating/deleting a lot of individual objects but we don't want it to emit standard events because we use a custom event managing objects by batch. However, we face the broken cursor issue with mubsub when replicating our app, thanks for the workaround on this issue. |
Skipping events in general will also bee available in the next release through #1270 |
I tried to use the trick with a hook returning In the debugger I could see that this equality test failed although both objects were shown as My understanding is that even if you create two JS Symbols using the same description, they are actually unique, see eg https://www.keithcirkel.co.uk/metaprogramming-in-es6-symbols/. What seems to appear in my app is that there are different "instances" of the symbol created because there are multiple imports of feather core or commons modules. So you should probably not use |
Disabling sending the event is now possible in Feathers v4 by setting |
At the moment I do not believe there is a way to disable the default events from being emitted when a service method call is completed e.g.
created
,patched
,removed
etc.It would be good if those events could be disabled from being emitted. There are certain cases where real-time events are not necessary for a service but I have not been able to find a way to disable them. Normally, this would not be an issue but since we are using
feathers-sync
those events are also synced using mongodb.We have been getting some
Mubsub: broken cursor
errors from time to time and I suspect they are due to really huge documents being saved in that collection (10,000+ lines) from one service which does some very large batch operations.I am creating this issue to see if this suggestion is something that you would consider implement, or even if there is another solution to this problem that I have not discovered yet. Any help is much appreciated 🙏
The text was updated successfully, but these errors were encountered: