-
Notifications
You must be signed in to change notification settings - Fork 197
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
Awaiting in the upgradeWebSocket callback prevents the websocket events from being registered correctly #954
Labels
Comments
Just realized I opened this in the Hono repository and not the middleware repo. Sorry about that. If you can move it to there somehow let me know, otherwise I'll close it and reopen it there. |
Does that mean this is |
Indeed @yusukebe |
@Rick-Phoenix I transferred the issue to |
Hi @nakasyou Do you have time to look at it? |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Hono are you using?
4.6.15
What runtime/platform is your app running on? (with version if possible)
Node 22
What steps can reproduce the bug?
(Even this will cause the same result)
What is the expected behavior?
What do you see instead?
Additional information
Awaiting in the callback seems to mess with the order of operations.
When not awaiting anything (whether the callback is async or not doesn't matter), the order of operation as seen in the debugger is this:
(the functions referenced here come from index.mjs in the @hono/node-ws package)
While awaiting, the order changes and looks like this
Moving the awaiting inside one of the events (onOpen, for example) or even earlier with a preceding middleware works fine.
The text was updated successfully, but these errors were encountered: