Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: v8.18.0 released major breaking change (not minor) and data sent as Blob (not Buffer) #2239

Closed
1 task done
titanism opened this issue Jul 4, 2024 · 7 comments
Closed
1 task done

Comments

@titanism
Copy link

titanism commented Jul 4, 2024

Is there an existing issue for this?

  • I've searched for any related issues and avoided creating a duplicate issue.

Description

See comment here #2229 (comment)

ws version

8.18.0

Node.js Version

latest

System

No response

Expected result

No response

Actual result

No response

Attachments

No response

@lpinca
Copy link
Member

lpinca commented Jul 4, 2024

Are you are setting websocket.binaryType to 'blob'?

@lpinca
Copy link
Member

lpinca commented Jul 4, 2024

Please share a minimal test case to reproduce the issue. I am unable to do it with the provided info. The following example works as expected.

import { WebSocket, WebSocketServer } from 'ws';
import { pack, unpack } from 'msgpackr';

const wss = new WebSocketServer({ port: 0 }, function () {
  const { port } = wss.address();
  const ws = new WebSocket(`ws://127.0.0.1:${port}`);

  ws.on('open', function () {
    ws.send(pack('Hello'));
  });

  ws.on('message', function (buf) {
    console.log(unpack(buf));
    ws.close();
  });
});

wss.on('connection', function (ws) {
  ws.on('message', function (buf) {
    ws.send(pack(unpack(buf)));
  });

  ws.on('close', function () {
    wss.close();
  });
});

@titanism
Copy link
Author

titanism commented Jul 4, 2024

@titanism are you are setting websocket.binaryType to 'blob'? Let's continue the discussion in #2239.

No, not at the moment. All we did was upgrade to latest version of ws and this issue came about.

@lpinca
Copy link
Member

lpinca commented Jul 5, 2024

Maybe it was already set. It was simply ignored before. I can't help without a test case.

@billti
Copy link

billti commented Jul 11, 2024

This is breaking our dependabot security bump also. Not sure why as it's a transitive dependency via JupyterLab. I'll see if I can figure out more, but sharing early here for more evidence.

microsoft/qsharp#1730 (see details at https://github.com/microsoft/qsharp/actions/runs/9895969380/job/27337054057?pr=1730#step:9:777)

@billti
Copy link

billti commented Jul 11, 2024

Ignore that last post - it was bumps to other packages as part of dependabot bumping 'ws' causing the issue in my case, (which I've fixed now via microsoft/qsharp#1734 ). Sorry for the noise.

@lpinca
Copy link
Member

lpinca commented Jul 18, 2024

I'm closing this due to inactivity.

@lpinca lpinca closed this as completed Jul 18, 2024
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

No branches or pull requests

3 participants