Skip to content

Multiple connect events when joining one or many namespaces #733

@matthewgoslett

Description

@matthewgoslett

I'm using a single socket for this application, and this socket can connect to one or many namespaces.

  1. socket.connect() is called
  2. The clientEvent: .connect event is emitted.
  3. socket.joinNamespace("/foo") is called
  4. The clientEvent: .connect event is emitted again.
  5. socket.joinNamespace("/bar") is called
  6. The clientEvent: .connect event is emitted again.

I would expect the event to only be called once, since the socket is already connected, and I've only just joined another namespace on this existing socket.
The business logic on connect shouldn't run every time a socket joins a namespace, unless there's a way to determine the namespace joined ("or connected to") in the connect event?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions