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

v1.32.4 breaks web sockets #18735

Closed
caramboleyo opened this issue Apr 17, 2023 · 10 comments
Closed

v1.32.4 breaks web sockets #18735

caramboleyo opened this issue Apr 17, 2023 · 10 comments
Assignees
Labels
bug Something isn't working correctly

Comments

@caramboleyo
Copy link

For some reason server now only pushes at the same time the browser client pulls something.
i use wss, establishing connection works fine, server onMessage works fine, but after using send on the server it just waits and does nothing until next incoming.

by downgrading to 1.32.3 everything works normal again.

Sidenote: with firefox websockets are waaaaay slower than with chrome.

@bartlomieju
Copy link
Member

This is already fixed by a411144

@caramboleyo
Copy link
Author

meaning it will be in the next release?

@bartlomieju
Copy link
Member

Correct, we will probably cut another patch release this week.

@caramboleyo
Copy link
Author

Last deno version were websockets were working properly is still 1.32.3
All versions later have issues.

@bartlomieju bartlomieju reopened this May 13, 2023
@bartlomieju
Copy link
Member

@caramboleyo is there a reproduction code you could share that triggers this error?

@jespertheend
Copy link
Contributor

jespertheend commented Aug 7, 2023

I can reproduce this, but only on secure websockets.
I'll try to get a repro running.
edit: Ah seems like this was already mentioned.

@caramboleyo
Copy link
Author

They replaced this bug with another:
#18977

@caramboleyo
Copy link
Author

I made a complex testcase now:
https://github.com/caramboleyo/deno-websocket-bug

@bartlomieju bartlomieju added the bug Something isn't working correctly label Aug 15, 2023
@josephrocca
Copy link
Contributor

josephrocca commented Sep 1, 2023

@bartlomieju @littledivy I just ran into something similar - v1.33.0 broke secure websockets - causes 20 second hangs when sending more than ~20kb of data in certain cases. Non-secure (ws://) still works fine for me.

EDIT: See a much more minimal replication here:

This script isn't particularly minimal, but it reproduces the problem I'm seeing: https://gist.github.com/josephrocca/ca159f837b351a9cd2dd31d728ed3ea9

As mentioned at the top of that file, just start the docker image, run cloudflared to proxy it to a https URL (no sign-up/account needed), alter the url variable in the script to match the one that cloudflared gives you, and run the script with deno run --allow-net main.js.

The script is 900kb but that's only because I'm sending a big jpeg data URL - it seems to more reliably reproduce if the string being sent is longer.

In 1.33.0 (and all later versions) you'll see at least a few "WARNING" logs indicating that the socket.send function took >5 seconds. Note that it will eventually send - it takes about 20 seconds, whereas it should take less than a second. In the prior version, 1.32.5 it works fine.

Equivalent node.js script works fine, for reference, but using npm:ws in Deno gives an unrelated error (not sure if npm:ws is supposed to be supported yet), so that's not a viable workaround right now (I personally can't downgrade to 1.32.5 because I'm relying on features that are only available in more recent versions of Deno).

@littledivy
Copy link
Member

We're tracking the secure websocket bug in #20355. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

5 participants