-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only set 'connected' to true after middleware execution
The Socket instance is only considered connected when the "connection" event is emitted, and not during the middleware(s) execution. ```js io.use((socket, next) => { console.log(socket.connected); // prints "false" next(); }); io.on("connection", (socket) => { console.log(socket.connected); // prints "true" }); ``` Related: #4129
- Loading branch information
1 parent
c0d8c5a
commit 02b0f73
Showing
2 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters