Skip to content

[1.3] Fix Door Lock cluster to not repond DUPLICATE when there is no duplication of credentials.#39279

Merged
andy31415 merged 1 commit intoproject-chip:v1.3-branchfrom
bzbarsky-apple:v1.3-door-lock-duplicate
May 29, 2025
Merged

[1.3] Fix Door Lock cluster to not repond DUPLICATE when there is no duplication of credentials.#39279
andy31415 merged 1 commit intoproject-chip:v1.3-branchfrom
bzbarsky-apple:v1.3-door-lock-duplicate

Conversation

@bzbarsky-apple
Copy link
Copy Markdown
Contributor

Spec issue tracking the spec not being clear:
https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/11707

Cherry-pick of #39254

Testing

YAML test added.

Copy link
Copy Markdown
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 addresses an issue in the Door Lock cluster where setting a credential to its existing value would incorrectly result in a DUPLICATE response. The fix in door-lock-server.cpp correctly modifies the duplicate check logic to ignore the credential slot being operated on, which resolves the issue. The added YAML test case in DL_UsersAndCredentials.yaml specifically verifies this scenario, ensuring that modifying a credential to its current value is now allowed and returns a success status.

The changes are well-targeted, and the code is clear. The accompanying comments and test case enhance understanding and maintainability. Overall, this is a good fix that improves the correctness of the credential management logic.

Summary of Findings

  • Code Correctness: The modification in door-lock-server.cpp correctly adjusts the duplicate credential check to ensure that setting a credential to its existing value does not trigger a DUPLICATE error. This aligns with the intended behavior described in the associated spec issue.
  • Testing: The new YAML test case in DL_UsersAndCredentials.yaml effectively validates the fix by attempting to modify a credential to its current value and expecting a successful outcome. This is a valuable addition for regression prevention.
  • Clarity and Maintainability: The code changes are minimal and easy to understand. The comment added in the C++ code provides excellent context regarding the spec ambiguity and the rationale for the change.

Merge Readiness

The changes in this pull request appear to be correct and well-tested for the specific issue they address. The code is clear and follows existing patterns. While I cannot approve the pull request myself, based on this review, the changes seem ready for merging pending successful CI checks and any other necessary reviews. No critical or high-severity issues were found in the changed code.

@andy31415 andy31415 changed the title Fix Door Lock cluster to not repond DUPLICATE when there is no duplication of credentials. [1.3] Fix Door Lock cluster to not repond DUPLICATE when there is no duplication of credentials. May 29, 2025
@andy31415 andy31415 merged commit d895bb7 into project-chip:v1.3-branch May 29, 2025
57 of 66 checks passed
@bzbarsky-apple bzbarsky-apple deleted the v1.3-door-lock-duplicate branch May 29, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants