Skip to content

Commit

Permalink
[nrf noup] Add a workaround to the reporting engine
Browse files Browse the repository at this point in the history
Currently, in the Matter 1.1.0.1 revision, there is a problem in
the reporting engine that causes wrong logic with marking mutated
change paths to send the report later. In the SetDirty method, we
called handler->setDirty before calling the InsertPathIntoDirtySet
method which caused the report not to be sent properly because
there was no new attribute to be sent on the DirtySet and the
generation version was forgotten, so the next data report did not
contain an update. It occurs when the controller sets too low value
for a minimal subscription interval and the device tries to send
a report scheduled to be sent immediately after the event occurs
without waiting to Inserting a path to the DirtySet.

This issue seems to be repaired in the Matter 1.2 revision, so we
can provide a workaround, and then revert/remove that PR during the
next synchronization with Matter SDK.
  • Loading branch information
ArekBalysNordic committed Oct 12, 2023
1 parent 5b26491 commit 802f525
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/reporting/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ CHIP_ERROR Engine::SetDirty(AttributePathParams & aAttributePath)

bool intersectsInterestPath = false;
InteractionModelEngine::GetInstance()->mReadHandlers.ForEachActiveObject(
[&aAttributePath, &intersectsInterestPath](ReadHandler * handler) {
[&aAttributePath, &intersectsInterestPath, this](ReadHandler * handler) {
// We call SetDirty for both read interactions and subscribe interactions, since we may send inconsistent attribute data
// between two chunks. SetDirty will be ignored automatically by read handlers which are waiting for a response to the
// last message chunk for read interactions.
Expand All @@ -839,6 +839,8 @@ CHIP_ERROR Engine::SetDirty(AttributePathParams & aAttributePath)
{
if (object->mValue.Intersects(aAttributePath))
{
// TODO: This is a workaround for Matter 1.1.0.1, remove it after upmerge to Matter 1.2
this->InsertPathIntoDirtySet(aAttributePath);
handler->SetDirty(aAttributePath);
intersectsInterestPath = true;
break;
Expand All @@ -853,7 +855,6 @@ CHIP_ERROR Engine::SetDirty(AttributePathParams & aAttributePath)
{
return CHIP_NO_ERROR;
}
ReturnErrorOnFailure(InsertPathIntoDirtySet(aAttributePath));

return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 802f525

Please sign in to comment.