Make client handling of invalid IDs a bit more lenient. (#30452)
Before this change, if a server happened to send an attribute report with an
invalid cluster or attribute id (very common for vendor-prefixed things that
people set up incorrectly), the entire read or subscription would fail and no
reports would be processed after the invalid id. This causes wildcard
subscriptions to completely fail if the device happens to have an invalid path
configured somewhere.
The new behavior is to completely skip that one AttributeReportIB and process
the other ones in the list.
Co-authored-by: Andrei Litvin <andy314@gmail.com>
diff --git a/src/app/ConcreteAttributePath.h b/src/app/ConcreteAttributePath.h
index 312311f..b06a4b8 100644
--- a/src/app/ConcreteAttributePath.h
+++ b/src/app/ConcreteAttributePath.h
@@ -48,6 +48,8 @@
mExpanded = false;
}
+ bool IsValid() const { return ConcreteClusterPath::HasValidIds() && IsValidAttributeId(mAttributeId); }
+
bool operator==(const ConcreteAttributePath & aOther) const
{
return ConcreteClusterPath::operator==(aOther) && (mAttributeId == aOther.mAttributeId);