Fix documented default for WebSocketResponse writer_limit - #13294
Fix documented default for WebSocketResponse writer_limit#13294LALITH0110 wants to merge 2 commits into
Conversation
The reference documented `writer_limit` as `65536` in the class signature and as "64 KB by default" in the parameter description, but the actual default is `DEFAULT_CHUNK_SIZE`, which is `2**18` (262144 bytes, 256 KiB). Readers sizing a WebSocket write buffer from the docs were working from a value four times smaller than the real one.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #13294 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 132 132
Lines 49023 49023
Branches 2551 2551
=======================================
Hits 48526 48526
Misses 373 373
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Merging this PR will not alter performance
Comparing Footnotes
|
What do these changes do?
Correct the documented default for
WebSocketResponse'swriter_limitparameter indocs/web_reference.rst.The reference documented it in two places:
writer_limit=65536The actual default in
aiohttp/web_ws.pyiswriter_limit: int = DEFAULT_CHUNK_SIZE, andDEFAULT_CHUNK_SIZEis2**18inaiohttp/helpers.py— that is 262144 bytes, or 256 KiB. So the documented value understated the real default by a factor of four.The signature now reads
writer_limit=262144, matching how the neighbouringmax_msg_size=4194304is written, and the prose now says "256 KiB by default".Documentation only — no code changes.
Are there changes in behavior for the user?
No. Nothing in the library changes. Users reading the docs to size a WebSocket write buffer will now see the value the code actually uses.
Is it a substantial burden for the maintainers to support this?
No. It is a two-line documentation correction with no ongoing maintenance cost.
Related issue number
None — found while comparing documented parameter defaults against the actual signatures.
Checklist
CONTRIBUTORS.txtCHANGES/folderDrafted with Claude Opus 5; reviewed by @LALITH0110.