crossws icon indicating copy to clipboard operation
crossws copied to clipboard

peer.close() does not pass code and reason to hooks

Open WerdoxDev opened this issue 4 months ago • 0 comments

Environment

Bun 1.1.29 Crossws 0.3.1

Reproduction

  1. Create a bun crossws instance
  2. Define a close hook
  3. Run peer.close(4001, "some reason");

Describe the bug

using peer.close(4001, "some-reason") does not pass the code and reason to the close hook.

It seems that an empty {} object is being passed to it. https://github.com/unjs/crossws/blob/05ded7bd961d26d310786f529c0deb8cf9dcf02c/src/adapters/bun.ts#L62

Additional context

No response

Logs

No response

WerdoxDev avatar Sep 29 '24 16:09 WerdoxDev