Skip to content

Commit 0ec10da

Browse files
Generate LockUserChange events when clearing a credential.
We were passing false for sendUserChangeEvent at all callsites of clearCredential(), which is not correct for the "clear a single credential" case. The other cases generate their own LockUserChange events.
1 parent d84f13e commit 0ec10da

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/app/clusters/door-lock-server/door-lock-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ void DoorLockServer::clearCredentialCommandHandler(
951951
}
952952

953953
commandObj->AddStatus(commandPath,
954-
clearCredential(commandPath.mEndpointId, modifier, sourceNodeId, credentialType, credentialIndex, false));
954+
clearCredential(commandPath.mEndpointId, modifier, sourceNodeId, credentialType, credentialIndex, true));
955955
}
956956

957957
void DoorLockServer::setWeekDayScheduleCommandHandler(chip::app::CommandHandler * commandObj,

src/app/tests/suites/DL_UsersAndCredentials.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,22 @@ tests:
20512051
- name: "NextUserIndex"
20522052
value: 2
20532053

2054+
- label: "Make sure a LockUserChange event was generated"
2055+
command: "readEvent"
2056+
event: "LockUserChange"
2057+
# I wish there were a way to not hardcode this 25, but it's experimentally
2058+
# determined: doing a read without an eventNumber filter here shows 24
2059+
# LockUserChange events before this removal.
2060+
eventNumber: 25
2061+
response:
2062+
value: {
2063+
LockDataType: LockDataTypeEnum.PIN,
2064+
DataOperationType: DataOperationTypeEnum.Clear,
2065+
OperationSource: OperationSourceEnum.Remote,
2066+
UserIndex: 1,
2067+
DataIndex: 1,
2068+
}
2069+
20542070
- label: "Clear the second PIN credential"
20552071
command: "ClearCredential"
20562072
timedInteractionTimeoutMs: 10000

0 commit comments

Comments
 (0)