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

Raise WebSocketDisconnect when WebSocket.send() excepts IOError #2425

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Jan 17, 2024

I think we should fix the above issue before merging this.

Uvicorn PR: encode/uvicorn#2218

@Kludex
Copy link
Member Author

Kludex commented Jan 19, 2024

@Kludex Kludex mentioned this pull request Jan 20, 2024
2 tasks
@Kludex Kludex force-pushed the disconnect-websocket-on-send branch from be299f6 to 200c6c1 Compare January 20, 2024 14:57
@Kludex
Copy link
Member Author

Kludex commented Jan 20, 2024

It turns out that now it's impossible to create a test with the TestClient with the changes I've implemented on #2427. 😆

It's because the TestClient will exit on client disconnect. I think the behavior is fine tho.

@Kludex Kludex requested a review from a team January 20, 2024 14:58
@Kludex
Copy link
Member Author

Kludex commented Jan 20, 2024

@encode/maintainers someone? 🙏

Copy link
Member

@michaeloliverx michaeloliverx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have a lot of context here but it looks fine at first glance and there is a test.

@Kludex Kludex merged commit b5126b2 into master Jan 20, 2024
5 checks passed
@Kludex Kludex deleted the disconnect-websocket-on-send branch January 20, 2024 15:08
nixroxursox pushed a commit to nixroxursox/starlette that referenced this pull request Mar 18, 2024
…encode#2425)

* Raise `WebSocketDisconnect` when `WebSocket.send()` excepts `IOError`

* Restrict the IOError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants