Skip to content

Commit 04eeef1

Browse files
Fix chunking of ACL reads. (#22267)
The chunking mechanism relies on errors being propagated as-is from the encoder to the caller of AttributeAccessInterface::Read. So we don't want to do any error mapping on the read errors, unlike write errors.
1 parent 2288333 commit 04eeef1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/clusters/access-control-server/access-control-server.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,11 @@ CHIP_ERROR ChipErrorToImErrorMap(CHIP_ERROR err)
461461

462462
CHIP_ERROR AccessControlAttribute::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
463463
{
464-
return ChipErrorToImErrorMap(ReadImpl(aPath, aEncoder));
464+
// Note: We are not generating any errors under ReadImpl ourselves; it's
465+
// just the IM encoding machinery that does it. And we should propagate
466+
// those errors through as-is, without mapping them to other errors, because
467+
// they are used to communicate various state within said enoding machinery.
468+
return ReadImpl(aPath, aEncoder);
465469
}
466470

467471
CHIP_ERROR AccessControlAttribute::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)

0 commit comments

Comments
 (0)