Skip to content
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

Prefixing socket events #418

Closed
devel-pa opened this Issue Feb 11, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@devel-pa
Copy link

devel-pa commented Feb 11, 2017

Hi,
Trying to integrate some puzzle pieces from different sets I found an issue, not necessarily a feathers only issue, but I think it would be a nice to have: prefixing socket events to avoid event collisions

https://github.com/feathersjs/feathers-authentication/blob/master/src/socket/handler.js#L194

Configurable or not, to have instead of socket.on('authenticate', authenticate); something like socket.on('fjs-authenticate', authenticate);

Best,
Paul

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Feb 18, 2017

authenticate is a pretty common event to use for Websocket authentication and the only special event outside of its services sent by Feathers. I'm not sure it is worth adding another configuration option since you probably won't have two different authentication mechanisms in your app.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Feb 24, 2017

I'm going to close this since we probably won't take this on. We'll definitely accept or help out with a pull request adding this option though.

@daffl daffl closed this Feb 24, 2017

@devel-pa

This comment has been minimized.

Copy link
Author

devel-pa commented Feb 24, 2017

Sorry for the delay, I have some health issues.
My problem with naming events is that sometimes 2 libraries can have same event, and even if it's not really used it have side effects.
As ex:
http://socketcluster.io/#!/docs/api-scsocket-client
where authenticate event does not pass to server as it's considered an internal event. Not a feathers issue, but more namespaced events (as long as they are transparent) I think are better.

As soon as I can, I'll submit a PR.

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Jul 25, 2017

We're going to be converting the authentication service to a proper Service which will make it so that the event is <service_name> created. Which should nullify this issue.

As a result I'm going to close this out. Thanks for reporting @devel-pa! 😄

@ekryski ekryski closed this Jul 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.