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
Hook is not being emitted #32
Comments
@PedroMD the hook is not intended to be emitted. What's the use you've got where you need the |
The problem is that usually on the server you get something like app.service('myservice').on('created', function(data, hook) {}); But Side note: Currently the hook object is not the same one from the actual hook chain but that will be solved with feathersjs/feathers#408. |
@daffl, got it :) I've noticed this issue exactly when I was setting up some custom event filters. Currently, I don't need the hook object on these filters, so I haven't tested my quick fix with another websocket framework. If I do, I will update this. |
This will be fixed in the next release. Caveat is that your hook context (without |
Hello everybody,
Been testing this and everything was fine until i noticed my hook was always undefined when adding filters to my events. I've forked it and hook is now being emitted as well, but I'm not sure this is the right approach: PedroMD@ce23831
I haven't submitted a PR yet, because it is causing issues with socket.io, whenever a client connects to it:
RangeError: Maximum call stack size exceeded at _hasBinary (/home/ubuntu/apps/x-api/node_modules/socket.io/node_modules/has-binary/index.js:25:22) at _hasBinary (/home/ubuntu/apps/x-api/node_modules/socket.io/node_modules/has-binary/index.js:49:63) at _hasBinary (/home/ubuntu/apps/x-api/node_modules/socket.io/node_modules/has-binary/index.js:49:63)
EDIT: Looks like hook can't be passed alongside the data, as the hook obj has some circular references, resulting in recursive calls that exceeded the stack size: socketio/socket.io#1665
Any thoughts on how to solve this? For now, I'm thinking of switching to primus and just use engine.io as the framework (I need polling-failover on my project, as having websocket as the only transport protocol is not an option). Not sure if engine.io will do the trick, but we'll see...
The text was updated successfully, but these errors were encountered: