Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic for handling custom jobs #164

Merged
merged 6 commits into from
Feb 17, 2021

Conversation

aggarw13
Copy link
Contributor

@aggarw13 aggarw13 commented Feb 15, 2021

  • Improve handling of custom jobs by calling the user-defined callback only if the Job ID and job document data can be parsed from JSON payload.
  • Remove instances of custom callback from from API

@aggarw13 aggarw13 force-pushed the hygiene/custom-job-handling branch from 4ddc82f to f4046d5 Compare February 16, 2021 01:04
@aggarw13 aggarw13 force-pushed the hygiene/custom-job-handling branch 2 times, most recently from 907014f to 2f9906f Compare February 16, 2021 01:20
source/ota.c Outdated Show resolved Hide resolved
static OtaJobParseErr_t parseJobDocFromCustomCallback( const char * pJson,
uint32_t messageLength );
static OtaJobParseErr_t handleCustomJob( const char * pJson,
uint32_t messageLength );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

messageLength should be size_t

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messageLength parameter comes from parseJobDoc function. Changing the type across the function call chain would be out of scope of this PR.

uint32_t messageLength )
/* If there is an error in parsing the json, check if it can be handled by external callback. */
static OtaJobParseErr_t handleCustomJob( const char * pJson,
uint32_t messageLength )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

messageLength should be size_t

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as this reply.

@aggarw13 aggarw13 merged commit 57a6d5b into aws:main Feb 17, 2021
@aggarw13 aggarw13 deleted the hygiene/custom-job-handling branch February 17, 2021 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants