Closed bdraco closed 2 months ago
The recent updates enhance the project's WebSocket functionality by introducing new timeout parameters, allowing for improved control over message reception. The minimum version requirement for the aiohttp
dependency has also been increased to leverage additional features and improvements. These changes collectively aim to optimize WebSocket interactions and ensure better compatibility with newer library versions.
File Summary | Changes Summary |
---|---|
pyproject.toml |
Updated aiohttp version constraint from >=3.9.0 to >=3.10.0 . |
src/uiprotect/api.py , src/uiprotect/websocket.py |
Added ws_receive_timeout parameter to constructors of WebSocketClient classes, enhancing WebSocket timeout configuration. |
src/uiprotect/websocket.py |
Updated SSL configuration logic and modified _websocket_inner_loop to use the new receive_timeout attribute for better message handling. |
tests/conftest.py |
Added ws_receive_timeout parameter to protect_client_ws function for improved WebSocket connection control. |
π In the garden where code blooms bright,
A hop of change brings new delight.
WebSocket whispers, "Timeouts now,"
With aiohttp's upgrade, we take a bow.
So letβs connect with grace and cheer,
As the future hops closer, drawing near! πΌ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Files | Coverage Ξ | |
---|---|---|
src/uiprotect/api.py | 55.21% <100.00%> (+0.05%) |
:arrow_up: |
src/uiprotect/websocket.py | 79.71% <100.00%> (+0.14%) |
:arrow_up: |
Description of change
Previous version of aiohttp did not always notice the connection was dropped. This is fixed in 3.10+
Require 3.10+ and remove the timeout so we do not disconnect if the websocket is quiet even when nothing is wrong.
Summary by CodeRabbit
New Features
ws_receive_timeout
parameter for improved WebSocket message reception control.Bug Fixes
Chores
aiohttp
to version3.10.0
or higher, ensuring access to newer features and improvements.