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: Missing WebSocket Connection State Validation on Close and Message Send Operations #3848

Open
4 tasks done
ashm-dev opened this issue Nov 6, 2024 · 0 comments
Open
4 tasks done
Labels
Bug 🐛 This is something that is not working as expected

Comments

@ashm-dev
Copy link

ashm-dev commented Nov 6, 2024

Description

The current WebSocket implementation in Litestar lacks connection state validation for critical operations. When attempting to close a connection, there is no check to verify if the connection has already been closed. Similarly, when sending messages, the implementation doesn't validate whether the connection is still active before attempting transmission. This can lead to attempts to perform operations on closed connections and potential application errors.

This is especially noticeable under heavy loads

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

No response

Litestar Version

latest
v2.12

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@ashm-dev ashm-dev added the Bug 🐛 This is something that is not working as expected label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 This is something that is not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant