socket.io-client-dart
socket.io-client-dart copied to clipboard
Unexpected List Type for 'status' Event with Connection State Recovery Enabled
Steps to Reproduce:
- Enable connection state recovery feature.
- Emit a 'status' event with a string value from the server using
socket.emit('status', 'waiting'). - Subscribe to the 'status' event on the client using the provided Dart library
socket.on('status', (data) {
....
}).
- 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:
Connection state recovery enabled:
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.