Skip to content

Commit 36e4ee3

Browse files
committed
Prevent messages on /update/accepted from incrementing shadowJsonVersionNum
Fixes #71
1 parent 1dd7bbf commit 36e4ee3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/aws_iot_shadow_records.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ static void topicNameFromThingAndAction(char *pTopic, const char *pThingName, Sh
168168
}
169169
}
170170

171-
static bool isAckForMyThingName(const char *pTopicName) {
171+
static bool isValidShadowVersionUpdate(const char *pTopicName) {
172172
if(strstr(pTopicName, myThingName) != NULL &&
173-
((strstr(pTopicName, "get/accepted") != NULL) || (strstr(pTopicName, "update/accepted") != NULL) ||
173+
((strstr(pTopicName, "get/accepted") != NULL) ||
174174
(strstr(pTopicName, "delta") != NULL))) {
175175
return true;
176176
}
@@ -201,7 +201,7 @@ static void AckStatusCallback(AWS_IoT_Client *pClient, char *topicName, uint16_t
201201
return;
202202
}
203203

204-
if(isAckForMyThingName(topicName)) {
204+
if(isValidShadowVersionUpdate(topicName)) {
205205
uint32_t tempVersionNumber = 0;
206206
if(extractVersionNumber(shadowRxBuf, pJsonHandler, tokenCount, &tempVersionNumber)) {
207207
if(tempVersionNumber > shadowJsonVersionNum) {

0 commit comments

Comments
 (0)