Remove "expectedVersion" field from job update message #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Remove hardcoded expectedVersion from OTA success message to prevent re-download loop
Description
This change addresses an issue where the device would continuously re-download an OTA package without success. The root cause was a hardcoded
expectedVersion
("2") in the OTA success message sent to AWS IoT Jobs.The
expectedVersion
field in the job status update is optional. This commit removes theexpectedVersion
from the success message payload by directly formatting the JSON string usingsnprintf
instead ofJobs_UpdateMsg
. This prevents the mismatch or incorrect versioning that led to the re-download loop.This resolves issue #120.
Test Steps
expectedVersion
in the success message was hardcoded and might not match the actual next expected version from the perspective of the OTA service or job document.ota_over_mqtt_demo.c
file.Checklist:
Related Issue
issue #120.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.