Skip to content

fix: drop direct sends from inactive server sockets #412

Closed

Description

@electrohyun

Description

A retained server Socket continues to send direct events and complete acknowledgements after it has disconnected. Socket.IO 4.7.5 and 4.8.3 drop direct sends from the old Socket, and its emitWithAck() remains pending. Smocket should reject delivery from an inactive connection generation without changing normal delivery or teardown ordering.

Reproduction

const oldSocket = await server.nextConnection();
oldSocket.disconnect();
await once(client, 'disconnect');

oldSocket.emit('stale');
const pending = oldSocket.emitWithAck('stale-ack');

client.connect();
const currentSocket = await server.nextConnection();
currentSocket.emit('marker');
await once(client, 'marker');
// Socket.IO: no stale event and pending ACK.
// Smocket 0.5.1: stale event is delivered and ACK resolves.

smocket version

0.5.1

Environment

Node 24.11.1, Vitest 4.1.10, Socket.IO 4.7.5 and 4.8.3

Activity

  1. added this to the v1.0.0 milestone on Aug 26, 2026
  2. added
    bug
    on Aug 26, 2026
  3. moved this from Backlog to In progress in smocketon Aug 26, 2026
  4. moved this from In progress to Done in smocketon Aug 26, 2026
  5. self-assigned this
    on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions