Skip to content

Commit

Permalink
Fix response determination in ClustersHelper. (project-chip#901)
Browse files Browse the repository at this point in the history
It would get things wrong if two different clusters had a response command with the same name.
  • Loading branch information
bzbarsky-apple authored Jan 19, 2023
1 parent 395f7e7 commit e1e8285
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,9 @@ function enhancedCommands(commands, types) {
// The 'response' property contains the response returned by the `selectCommandById`
// helper. But this one does not contains all the metadata informations added by
// `enhancedItem`, so instead of using the one from ZAP, retrieve the enhanced version.
const clusterName = command.clusterName;
command.response = commands.find(
(command) => command.name == responseName
(command) => command.name == responseName && command.clusterName == clusterName
);
// We might have failed to find a response if our configuration is weird
// in some way.
Expand Down

0 comments on commit e1e8285

Please sign in to comment.