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

Handle cancellation while waiting for an encrypted IP response #354

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

bdraco
Copy link
Collaborator

@bdraco bdraco commented Jan 13, 2024

Only fixes the IP controller. BLE and coap likely have similar issues. I will fix BLE as well but I don't use coap so no way to test that one

home-assistant/core#97888

Only fixes the IP controller.  BLE and coap likely have similar issues

home-assistant/core#97888
Copy link

codecov bot commented Jan 13, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (f25dcb1) 74.50% compared to head (d802a81) 74.60%.

Files Patch % Lines
aiohomekit/controller/ip/connection.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   74.50%   74.60%   +0.09%     
==========================================
  Files          99       99              
  Lines        9301     9320      +19     
==========================================
+ Hits         6930     6953      +23     
+ Misses       2371     2367       -4     

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

@bdraco bdraco marked this pull request as ready for review January 13, 2024 07:07
Comment on lines +118 to +121
# If we get a timeout or any other exception then we need to
# close the connection as we are now out of sync with the device
# and any future requests will fail since the encryption counters
# will be out of sync.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We might be able to redo the pair verify and start over but I doubt devices handle that well so I think the safest thing to do is close and reopen to ensure good state

@bdraco
Copy link
Collaborator Author

bdraco commented Jan 13, 2024

thanks. will push a release shortly if everything passes on 3.12 as well

@bdraco bdraco merged commit 4cd3ccc into main Jan 13, 2024
12 checks passed
@bdraco bdraco deleted the cancel_ip_fix branch January 13, 2024 08:10
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