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: ignores WebSocket connection with same sid after upgrade #46

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

Totodore
Copy link
Contributor

@Totodore Totodore commented Jul 2, 2023

The second websocket created after an upgrade should gracefully close and not throw an error as specified in the official implementation. Moreover in the same test for the socket.io test suite the implementation wait for the second websocket to gracefully close.

Here is an example of engine.io server which fails at validating this test:

const engine = require('engine.io');
const server = engine.listen(3000, {
    pingInterval: 300,
    pingTimeout: 200
});

server.on('connection', socket => {
    socket.on('message', data => {
        socket.send(data);
    });
});

It would be nice to be able to use a separate engine.io test suite in CI for our rust server implementation socketioxide.

Closes socketio/socket.io-protocol#29
Closes Totodore/socketioxide#15

The second websocket created after an upgrade should gracefully close and not throw an error as specified the official implementation.
Moreover in the same test for the `socket.io` test suite the implementation wait for the second websocket to gracefully closee.
@Totodore
Copy link
Contributor Author

Totodore commented Jul 2, 2023

@darrachequesne even the new v3 test-suite waits for a close event and not an error event.

@darrachequesne darrachequesne merged commit 05488c4 into socketio:main Jul 8, 2023
@darrachequesne
Copy link
Member

Good catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants