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

query option not referenced anymore #1086

Closed
sopinon opened this Issue Mar 7, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@sopinon

sopinon commented Mar 7, 2017

You want to:

  • report a bug
  • request a feature

Current behaviour

In earlier versions (tested with 1.4.7) it was possible to change properties inside the given query options. This is not possible anymore, the reference to the query object get lost.

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

var queryObj = { userOldSessionId:'none', userReconnecting:0 };
var socket = io('https://myurl/namespace', { query : queryObj});

// change query options on connect
socket.on('connect', function(){
    queryObj.userOldSessionId = socket.io.engine.id;
    queryObj.userReconnecting = 1;
});

With this example it was possible earlier to detect reconnection server side and restore settings for this client on successful reconnection. This is not possible anymore, in inspector you will always see queries with the 'old' query options.

sopinon pushed a commit to sopinon/socket.io-client that referenced this issue Mar 7, 2017

@darrachequesne darrachequesne referenced this issue May 31, 2017

Merged

do not update the opts.query reference #1121

1 of 5 tasks complete

@darrachequesne darrachequesne added this to the 2.0.2 milestone Jun 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment