You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the retries option is enabled in the Socket.IO client, the client emits the initial event twice inside the 'connect' handler. However, this issue does not occur when the retries option is not provided.
To Reproduce
Please fill the following code example:
Socket.IO server version: 4.8.1
Server
constio=newServer(httpServer,{});io.on("connection",(socket)=>{console.log(`connect ${socket.id}`);socket.on('data',(data,callback)=>{console.log('Incoming message from client: ',data);callback(null,{success: true,message: 'Acknowledged...'});});socket.on("disconnect",(reason)=>{console.log(`disconnect ${socket.id} due to ${reason}`);});});
Expected behavior
The event inside the 'connect' handler should be emitted only once, regardless of whether the retries option is enabled or disabled.
Platform:
Device: Windows/google chrome
OS: Windows/google chrome
Additional context
Console output:
I debugged this issue and it seems like:
After the client emits the connect event, the event queue is drained with the force option set to true. This action retriggers events that were already added to the queue & awaiting acknowledgement due to the retries option. As a result, the initial event is emitted twice.
The text was updated successfully, but these errors were encountered:
Describe the bug
When the retries option is enabled in the Socket.IO client, the client emits the initial event twice inside the 'connect' handler. However, this issue does not occur when the retries option is not provided.
To Reproduce
Please fill the following code example:
Socket.IO server version:
4.8.1
Server
Socket.IO client version:
4.8.1
Client
Expected behavior
The event inside the 'connect' handler should be emitted only once, regardless of whether the retries option is enabled or disabled.
Platform:
Additional context
Console output:
I debugged this issue and it seems like:
After the client emits the connect event, the event queue is drained with the force option set to true. This action retriggers events that were already added to the queue & awaiting acknowledgement due to the retries option. As a result, the initial event is emitted twice.
The text was updated successfully, but these errors were encountered: