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 mqtt3 suback returned qos behavior #340

Closed
wants to merge 6 commits into from
Closed

Conversation

xiazhvera
Copy link
Contributor

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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (17ee24a) 82.41% compared to head (0ef6d3f) 82.40%.

Files Patch % Lines
source/client.c 60.00% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

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
Copy link
Contributor

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.

Comment on lines 1697 to 1698
/* 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. */
Copy link
Contributor

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

@xiazhvera
Copy link
Contributor Author

Hold off because it introduce a behavior change.

@xiazhvera xiazhvera closed this Jan 23, 2024
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