-
Notifications
You must be signed in to change notification settings - Fork 29
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 mqtt3 suback returned qos behavior #340
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #340 +/- ##
==========================================
- Coverage 82.41% 82.40% -0.02%
==========================================
Files 20 20
Lines 8779 8785 +6
==========================================
+ Hits 7235 7239 +4
- Misses 1544 1546 +2 ☔ View full report in Codecov by Sentry. |
err |= aws_array_list_push_back(&cb_list, &subscription); | ||
} | ||
AWS_ASSUME(!err); | ||
task_arg->on_suback.multi(&connection->base, packet_id, &cb_list, error_code, task_arg->on_suback_ud); | ||
aws_array_list_clean_up(&cb_list); | ||
} else if (task_arg->on_suback.single) { | ||
// The topic->request.qos should be already updated to returned qos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trivial: Here and below in s_subscribe_single_complete
we could probably change the topic->request-qos directly instead of creating a separate returned_qos
. I don't believe the topic->request is used after the point of invoking the on_suback
callbacks in either case.
tests/v3/connection_state_test.c
Outdated
/* Subscribe to multiple topics prior to connection, make a CONNECT, have the server send PUBLISH messages, | ||
* make sure they're received, then send a DISCONNECT. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trivial: The test description seems to be incorrect
Hold off because it introduce a behavior change. |
Issue #, if available:
Description of changes:
The Mqtt3 client would now return
AWS_MQTT_QOS_FAILURE
as qos value if the subscription failed with error code.While Mqtt3 client would directly return the request qos value. This change would introduce behavior changes in CPP, Python and NodeJS.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.