Skip to content

[fix] Returns not unique id for cache connection #1225

Closed
@mikhailtsai

Description

@mikhailtsai

Note: for support questions, please use one of these channels: stackoverflow or slack

You want to:

  • report a bug
  • request a feature

Current behaviour

Inability to work with two different socket servers and namespaces

Steps to reproduce (if the current behaviour is a bug)

const PATH_1 = '/path-1/socket.io';
const PATH_2 = '/path-2/socket.io';
const socket1 = io('http://localhost', { path: PATH_1 });
const socket2 = io('http://localhost', { path: PATH_2 });
const socket2_with_nsp = io('http://localhost/namespace', { path: PATH_2 });

// Problem:
console.log(socket2_with_nsp.io.opts.path === PATH_1); // true

Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.

Expected behaviour

console.log(socket2_with_nsp.io.opts.path === PATH_2); // true

Setup

  • OS:
  • browser:
  • socket.io version: 2.1.1

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Please, review my PR with the fix: #1224

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions