Skip to content

test(sio): add tests for acks upon client disconnection - #5652

Open
abdoahmed07 wants to merge 1 commit into
socketio:mainfrom
abdoahmed07:test-ack-disconnect
Open

abdoahmed07 wants to merge 1 commit into
socketio:mainfrom
abdoahmed07:test-ack-disconnect

Conversation

@abdoahmed07

Copy link
Copy Markdown

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behavior

I could not find a server test for a client that disconnects before it acknowledges an event. The client package already has tests for acks upon disconnection.

New behavior

This adds two tests, one with a callback and one with a promise. With timeout(), the server gets an error when the client disconnects without answering. The library code is not changed.

Other information (e.g. related issues)

Related to #1918. Without timeout(), the callback was still not called 3 seconds after the client disconnected (socket.io 4.8.4). Is that intended on the server side?

I used an AI assistant to write the tests, and ran them locally.

test(sio): add tests for acks upon client disconnection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant