-
Notifications
You must be signed in to change notification settings - Fork 102
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
Drop use of Monitor._ws.open and Connection._ws.closed #1208
Conversation
The websockets library has dropped the properties "open" and "closed" since websockets-13.0[0], this patch makes the changes needed to check for the connection's state as suggested by the documentation. [0] python-websockets/websockets@7c8e0b9
I imagine that would allow us to upgrade to websockets 14 or remove the dependency upper bound, wouldn’t it? |
Pls reword commit messages to follow conventional commits |
The websockets library defines 4 values for This PR references only two. I wonder what about the other two. |
@@ -357,7 +358,7 @@ async def close(self, to_reconnect: bool = False): | |||
tasks_need_to_be_gathered.append(self._debug_log_task) | |||
self._debug_log_task.cancel() | |||
|
|||
if self._ws and not self._ws.closed: | |||
if self._ws and self._ws.state is not State.CLOSED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking through websockets code, the library already handles the corner cases and we should close the connection unconditionally.
Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208
Continued in #1216 |
* Pin websockets library Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208 * Migrate to actions/upload-artifact@v4
* Pin websockets library Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208 * Migrate to actions/upload-artifact@v4 (cherry picked from commit d758d6d)
* Pin websockets library Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208 * Migrate to actions/upload-artifact@v4 (cherry picked from commit d758d6d)
* Pin websockets library Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208 * Migrate to actions/upload-artifact@v4 (cherry picked from commit d758d6d) (cherry picked from commit e8d72f4)
* Pin websockets library Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208 * Migrate to actions/upload-artifact@v4 (cherry picked from commit d758d6d) (cherry picked from commit e8d72f4) (cherry picked from commit 9b5291c)
* Pin websockets library Set upper bound for websockets until libjuju is compatible with newer versions. See juju/python-libjuju#1208 * Migrate to actions/upload-artifact@v4 (cherry picked from commit d758d6d) (cherry picked from commit e8d72f4) (cherry picked from commit 9b5291c)
The websockets library has dropped the properties "open" and "closed" since websockets-13.0[0], this patch makes the changes needed to check for the connection's state as suggested by the documentation.
[0] python-websockets/websockets@7c8e0b9
Fixes #1207