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 late encryption error #1055

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Handle late encryption error #1055

wants to merge 4 commits into from

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Feb 3, 2025

We should not see an encryption error after unless the data is corrupted on the wire or there is memory corruption on the ESP, apparently this can happen. While everything worked OK, the exception reached all the way into asyncio internals so its better to handle it internally.

fixes #1044

We should not see an encryption error after
unless the data is corrupted on the wire,
apparently this can happen

fixes #1044
Copy link

codspeed-hq bot commented Feb 3, 2025

CodSpeed Performance Report

Merging #1055 will not alter performance

Comparing late_encrypt_error (c43b8c1) with main (ab15d7b)

Summary

✅ 4 untouched benchmarks

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ab15d7b) to head (c43b8c1).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1055   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         2681      2681           
=========================================
  Hits          2681      2681           

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

# but it could happen if the server sends a bad frame see
# issue https://github.com/esphome/aioesphomeapi/issues/1044
self._handle_error_and_close(
InvalidEncryptionKeyAPIError(
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we need a new exception type for late encryption errors....

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.

Error doing job: Fatal error: protocol.data_received() call failed. (None)
1 participant