socket.io-client-dart icon indicating copy to clipboard operation
socket.io-client-dart copied to clipboard

Unexpected List Type for 'status' Event with Connection State Recovery Enabled

Open kryptamine opened this issue 1 year ago • 1 comments

Steps to Reproduce:

  1. Enable connection state recovery feature.
  2. Emit a 'status' event with a string value from the server using socket.emit('status', 'waiting').
  3. Subscribe to the 'status' event on the client using the provided Dart library
   socket.on('status', (data) {
        ....
   }).
  1. Observe that the data parameter is of type List with two elements instead of the expected string.

Expected Behavior:

The 'status' event should deliver a string as the data parameter, as it does when connection state recovery is disabled.

Actual Behavior:

The 'status' event delivers a List with two elements (pid and string)

Environment:

Socket.IO client Dart library version: 2.0.3 Connection state recovery settings:

  connectionStateRecovery: {
    maxDisconnectionDuration: 2 * 60 * 1000,
    skipMiddlewares: true,
  },

Screenshots:

Connection state recovery disabled:

image

Connection state recovery enabled:

image

kryptamine avatar Jan 21 '24 16:01 kryptamine

After tested on Socket.io client (JS), it received the extra data as well. So, this could be like a Socket.io server's bug, because it will send an unique id at the end of the arguments when enabled connection state recovery.

jumperchen avatar Feb 17 '24 14:02 jumperchen