🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@puddly
Copy link
Collaborator

@puddly puddly commented Nov 17, 2025

This is an independent fix that complements #1636. It should be a safer fix for home-assistant/core#150589.

The vast majority of commands sent by devices to zigpy are attribute reports. These should never match up to commands.

Copilot AI review requested due to automatic review settings November 17, 2025 19:56
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.31%. Comparing base (a78dd9f) to head (5441c9b).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1707   +/-   ##
=======================================
  Coverage   99.31%   99.31%           
=======================================
  Files          63       63           
  Lines       12184    12186    +2     
=======================================
+ Hits        12100    12102    +2     
  Misses         84       84           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds logic to prevent attribute reports from being incorrectly matched with pending ZCL command/response pairs, addressing a collision issue where attribute reports with matching TSNs could interfere with request-response matching.

  • Adds an isinstance check in _maybe_match_response to filter out Report_Attributes commands from response matching
  • Includes comprehensive test coverage to verify attribute reports don't resolve pending requests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
zigpy/device.py Added check in _maybe_match_response method to prevent Report_Attributes commands from matching with pending requests
tests/test_device.py Added test case test_attribute_report_not_matched_with_request to verify attribute reports don't incorrectly resolve pending command requests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@puddly puddly merged commit c677945 into zigpy:dev Nov 25, 2025
18 checks passed
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.

1 participant