From dd784cb0a7b9268f0a3ddf499e153ed97277ba8b Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Mon, 14 Mar 2022 15:41:10 -0700 Subject: [PATCH] Fix numRetries for subscription (#16199) -- clear the counter back to 0 on successful establishment of a subscription. --- src/app/ReadClient.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 2e0ad3ce8f57de..0595d9bb1e1674 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -769,6 +769,11 @@ CHIP_ERROR ReadClient::ProcessSubscribeResponse(System::PacketBufferHandle && aP MoveToState(ClientState::SubscriptionActive); + if (mReadPrepareParams.mResubscribePolicy != nullptr) + { + mNumRetries = 0; + } + RefreshLivenessCheckTimer(); return CHIP_NO_ERROR;