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

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

Closed
1 of 2 tasks
mikhailtsai opened this issue Jul 28, 2018 · 1 comment
Closed
1 of 2 tasks

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

mikhailtsai opened this issue Jul 28, 2018 · 1 comment

Comments

@mikhailtsai
Copy link

mikhailtsai commented Jul 28, 2018

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

darrachequesne added a commit that referenced this issue Feb 3, 2021
Previously, the following code:

```js
const socket1 = io({
  path: "/test1"
});
const socket2 = io({
  path: "/test2"
});
```

would result in one single Manager, with the "/test2" path being
silently ignored.

Two distinct Manager instances will now be created.

Related: #1225
@darrachequesne
Copy link
Member

Fixed by 7a0c2b5.

sunrise30 added a commit to sunrise30/socket.io-client that referenced this issue Jan 8, 2022
Previously, the following code:

```js
const socket1 = io({
  path: "/test1"
});
const socket2 = io({
  path: "/test2"
});
```

would result in one single Manager, with the "/test2" path being
silently ignored.

Two distinct Manager instances will now be created.

Related: socketio/socket.io-client#1225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants