Skip to content

fix(generaldiagnostics): Fix homeassistant commissioning of light_eth #376

Closed
thouters wants to merge 1 commit intoproject-chip:mainfrom
thouters:mr/fix-ha-commissioning
Closed

fix(generaldiagnostics): Fix homeassistant commissioning of light_eth #376
thouters wants to merge 1 commit intoproject-chip:mainfrom
thouters:mr/fix-ha-commissioning

Conversation

@thouters
Copy link
Contributor

Fix light_eth example of rs-matter-stack.

fn network_interfaces() gets called with
ArrayAttributeRead::ReadOne index beyond the length of the interfaces present.

Return a ConstraintError when no netif was matched.

The change fixes this error message which aborts the commissioning process:

rs_matter::respond] Responder: Handler 0 / exchange 7::1: Abandoned because of error Error::InvalidAction

@CLAassistant
Copy link

CLAassistant commented Feb 11, 2026

CLA assistant check
All committers have signed the CLA.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @thouters, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue preventing the successful commissioning of the light_eth example with Home Assistant. The fix involves refining the error handling logic within the rs-matter-stack to return a more appropriate ConstraintError when an array attribute read operation encounters an unexpected state, thereby preventing the premature abortion of the commissioning process.

Highlights

  • Error Handling Correction: Corrected an error code from InvalidAction to ConstraintError within the GenDiagHandler when an array attribute read operation fails to take a parent builder.
  • Home Assistant Commissioning Fix: Resolved a commissioning issue for the light_eth example in the rs-matter-stack with Home Assistant, which was previously failing due to an Error::InvalidAction.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • rs-matter/src/dm/clusters/gen_diag.rs
    • Changed the error code returned from ErrorCode::InvalidAction to ErrorCode::ConstraintError when a parent builder cannot be taken during an array attribute read operation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly changes the error code from InvalidAction to ConstraintError when an out-of-bounds index is requested for the network_interfaces attribute list. This aligns with the Matter specification, which mandates a CONSTRAINT_ERROR for such cases. I have one minor suggestion to remove a now-obsolete TODO comment.

@thouters thouters force-pushed the mr/fix-ha-commissioning branch from 26f7a1b to 60f3b1a Compare February 11, 2026 22:11
Fix light_eth example of rs-matter-stack.

fn network_interfaces() gets called with
ArrayAttributeRead::ReadOne index beyond the length of the interfaces
present.

Return a ConstraintError when no netif was matched.

The change fixes this error message which aborts the commissioning
process:

rs_matter::respond] Responder: Handler 0 / exchange 7::1: Abandoned
because of error Error::InvalidAction
@github-actions
Copy link

PR #376: Size comparison from d502046 to 7aaea66

Full report (8 builds for (core), dimmable-light, onoff-light, onoff-light-bt, speaker)
platform target config section d502046 7aaea66 change % change
(core) riscv32imac-unknown-none-elf infodefmt-optz-ltofat FLASH 378316 378322 6 0.0
RAM 64712 64712 0 0.0
thumbv6m-none-eabi infodefmt-optz-ltofat FLASH 317900 317848 -52 -0.0
RAM 61248 61248 0 0.0
thumbv7em-none-eabi infodefmt-optz-ltofat FLASH 291340 291332 -8 -0.0
RAM 60736 60736 0 0.0
x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 811159 811175 16 0.0
RAM 64400 64400 0 0.0
dimmable-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 1873952 1873592 -360 -0.0
RAM 46584 46584 0 0.0
onoff-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 1800640 1800248 -392 -0.0
RAM 46576 46576 0 0.0
onoff-light-bt x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 3113920 3113944 24 0.0
RAM 9304 9304 0 0.0
speaker x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 801104 801080 -24 -0.0
RAM 2832 2832 0 0.0

@thouters thouters changed the title fix(homeassistant): Fix homeassistant commissioning of light_eth fix(generaldiagnostics): Fix homeassistant commissioning of light_eth Feb 12, 2026
@ivmarkov
Copy link
Contributor

@thouters please run cargo fmt

@ivmarkov ivmarkov mentioned this pull request Feb 13, 2026
ivmarkov added a commit that referenced this pull request Feb 13, 2026
Subject says it all - apply a `cargo fmt` to PR #376.

---------

Co-authored-by: Thomas Langewouters <thomas.langewouters@thouters.be>
@ivmarkov
Copy link
Contributor

See #377

@ivmarkov ivmarkov closed this Feb 13, 2026
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.

4 participants