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

NOISSUE - Fix Send Response for Publishing Message #1740

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

rodneyosodo
Copy link
Member

@rodneyosodo rodneyosodo commented Mar 7, 2023

What does this do?

Adds functionality to send response for successfully publishing messages.

Which issue(s) does this PR fix/relate to?

NOISSUE

List any changes that modify/break current functionality

Previously, we only sent response when we encountered an error. This meant when you try ab publish message using coap-cli it would not automatically close after successfully publishing the message. It would close after the timeout has reached. This was because we were not returning a response upon successful publishing of message

Have you included tests for your changes?

No

Did you document any new/modified functionality?

No

Notes

How to reproduce the problem would be to try and publish message using coap-cli

coap-cli post channels/<channel_id>/messages -auth <thing_key> -d 'message'

@rodneyosodo rodneyosodo requested a review from a team as a code owner March 7, 2023 08:17
SammyOina
SammyOina previously approved these changes Mar 8, 2023
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
dborovcanin
dborovcanin previously approved these changes Mar 16, 2023
}
sendResp(w, &resp)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider using defer sendResp(w, &resp) as a little more elegant alternative.

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
@rodneyosodo rodneyosodo dismissed stale reviews from dborovcanin and SammyOina via e010727 March 16, 2023 09:21
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@dborovcanin dborovcanin merged commit d4fc7ba into absmach:master Mar 16, 2023
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.

4 participants