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

fix(WebSocket): handle OSError upon send() + fix max_receive_queue == 0 #2324

Merged
merged 10 commits into from
Sep 17, 2024

Conversation

vytas7
Copy link
Member

@vytas7 vytas7 commented Sep 6, 2024

  • Revise and rewrite parts of Lost Connections.
  • Add unit tests (with full coverage) for the max_receive_queue == 0 case.
  • Revise the test client if it could better simulate both behaviours depending on the simulated spec version.
  • Add Uvicorn tests in test_asgi_servers.py that exercise the max_receive_queue == 0 case, and catches an error from the webserver's OSError upon send().
  • Change E2E tests not to use buffering (since we know that use Uvicorn there).

Closes #2292.

@vytas7
Copy link
Member Author

vytas7 commented Sep 6, 2024

Note that I still need to revise the wording of our WebSocket docs, hence Draft (for now).

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (87e0454) to head (db2c3c4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2324   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         7522      7539   +17     
  Branches      1275      1281    +6     
=========================================
+ Hits          7522      7539   +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vytas7 vytas7 changed the title feat(WebSocket): handle OSError upon send() fix(WebSocket): handle OSError upon send() + fix max_receive_queue == 0 Sep 8, 2024
@vytas7 vytas7 marked this pull request as ready for review September 9, 2024 05:31
@vytas7 vytas7 marked this pull request as draft September 9, 2024 05:31
@CaselIT
Copy link
Member

CaselIT commented Sep 12, 2024

I'm waiting for this to exit draft. let me know if I should review before then

@vytas7
Copy link
Member Author

vytas7 commented Sep 12, 2024

Thanks @CaselIT , I haven't had much time to work on this, there are a couple of items remaining. Code-wise (not tests) I am not planning any more changes, so time permitting you could take a look at that part.
Documentation is ready too I think.

I need to add more tests, and morph newsfragments.

@vytas7
Copy link
Member Author

vytas7 commented Sep 13, 2024

@CaselIT maybe this PR is still not perfect (nothing is), but it is IMHO ready for review!

@vytas7 vytas7 marked this pull request as ready for review September 13, 2024 21:21
Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

looks ok, left a suggestion

falcon/asgi/ws.py Show resolved Hide resolved
@vytas7 vytas7 merged commit b29fd55 into falconry:master Sep 17, 2024
37 checks passed
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.

ASGI WebSocket protocol 2.4: send() may raise OSError
2 participants