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

WebSocket: message handler sometimes called with null data (potentially issue in frame processing) #2859

Open
farwayer opened this issue Feb 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@farwayer
Copy link

farwayer commented Feb 27, 2024

Bug Description

I’ll say right away that the bug is floating and I don’t have a ready-made recipe for reproducing it. The bug usually appeared during debugging. Apparently, timings and the sequence of data arrival are important. The server should also send pings to get this effect.

From the screenshot you can see that the websocketMessageReceived function is called with this.#info.originalOpcode=9 (PING frame type), which should not happen.

Logs & Screenshots

2024_02_27T05 33 03

Environment

node v21.6.2

@farwayer farwayer added the bug Something isn't working label Feb 27, 2024
@KhafraDev
Copy link
Member

does this only occur during debugging?

@farwayer
Copy link
Author

farwayer commented Feb 27, 2024

Yes, I only encountered this error in debugging. But, I assume that the problem is not related to it, but to the timings. Before null in the message handler received, two breakpoints are triggered. But if you send a ping from the server with a little delay (calling process.hrtime() before sending is enough), then everything goes fine.

@KhafraDev
Copy link
Member

KhafraDev commented Feb 27, 2024

Maybe, I think there's definitely room for improvement in parsing control frames (frames that can't be fragmented). I'll look into it but no promises.

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

No branches or pull requests

2 participants