socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

Connection State Recovery: Client->Server resync

Open bryghtlabs-richard opened this issue 5 months ago • 0 comments

Is your feature request related to a problem? Please describe. Connection state recovery only recovers packets that are buffered on the server. On reconnect, these are then sent to the client. But client->server packets are not handled this way.

Describe the solution you'd like I'd like to have connection state recovery support packet retry from client to server as well. All client->server events would include an offset. On reconnect the server would send the latest client->server offset to the client and the client would repeat any missing events.

It would be nice to send the client->server offset back to the client periodically, or perhaps on every server->client event. This way the client could quickly purge events from its buffer.

This would probably involve a change to the wire format.

Describe alternatives you've considered Practically, we end up writing a lot of extra handlers on reconnect to resync client state back to the server.

bryghtlabs-richard avatar Jun 23 '25 18:06 bryghtlabs-richard