Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

Prefixing socket events #418

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

Prefixing socket events #418

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

Comments

@devel-pa
Copy link

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
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
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 as completed Feb 24, 2017
@devel-pa
Copy link
Author

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
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 as completed Jul 25, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants