Allow empty notification when using "AcquireNotify"#1983
Allow empty notification when using "AcquireNotify"#1983dlech wants to merge 2 commits intohbldh:developfrom
Conversation
Add parametrization to test start_notify() with both use_start_notify True and False on Linux. These have significantly different code paths.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1983 +/- ##
===========================================
+ Coverage 52.06% 52.45% +0.38%
===========================================
Files 43 43
Lines 4091 4097 +6
Branches 503 504 +1
===========================================
+ Hits 2130 2149 +19
+ Misses 1830 1817 -13
Partials 131 131
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This PR aims to allow valid zero-length payloads to pass through the BlueZ AcquireNotify path instead of being treated as an error, addressing issue #1982 in the Linux backend.
Changes:
- Removed the explicit empty-read check in the BlueZ notification fd reader.
- Expanded integration notification/indication tests to exercise both
StartNotifyandAcquireNotifypaths on BlueZ. - Added an integration test for empty notification payload delivery and documented the fix in the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
bleak/backends/bluezdbus/client.py |
Adjusts AcquireNotify fd read handling for empty payloads. |
tests/integration/test_client_characteristics.py |
Broadens notification test coverage and adds an empty-payload notification test. |
CHANGELOG.rst |
Documents the BlueZ empty-notification fix under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b140a54 to
9a64167
Compare
…reNotify Drop the check for empty data in the AcquireNotify callback. Normally in Python, read() returning an empty bytes object indicates EOF. In this case, it just means that a notification with an empty payload was received, which is perfectly valid. Fixes: hbldh#1982
9a64167 to
bdbbf89
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Drop the check for empty data in the "AcquireNotify" callback. Normally in Python,
read()returning an empty bytes object indicates EOF. In this case, it just means that a notification with an empty payload was received, which is perfectly valid.Fixes: #1982