-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Websocket behaviour change since 1.44.3 #24618
Comments
Seems intended behaviour. const deferred = Promise.withResolvers<void>();
socket.onopen = () => {
console.log("WebSocket connection opened");
deferred.resolve();
};
await deferred.promise;
|
@littledivy I agree with you, it was only that this did work in 1.44.2 (and maybe earlier). I've fixed our code to return the response and properly handle the websocket in the response to At least we can document this here in case others hit this too. I'll try to dig up the exact commit that caused this so we can document that too. |
It seems like this is the PR that introduced the change in behaviour. #24226. If I remove this, then the old behaviour returns. |
The documentation states:
Which is probably good enough to explain the issue. I'm happy to close this as I agree that this code doesn't conform to the documented API. Since this did work in previous versions of Deno but failed after 1.44.3, this issue may help another person who stumbles upon this. |
I'll close - if others run into this they can find this issue :) |
Version: Deno 1.44.3+
Since Deno 1.44.3 and later the following web socket example no longer runs:
Seems to be deadlock, in that the response is not returned until the websocket is opened, but the web socket is no longer opened until the Response is returned.
I can do some digging to find out what commit introduced this change.
The text was updated successfully, but these errors were encountered: