Auto-generate client ids in MQTT5#404
Merged
Merged
Conversation
added 2 commits
July 7, 2025 10:53
… and no client id specified
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #404 +/- ##
==========================================
+ Coverage 84.67% 84.74% +0.07%
==========================================
Files 25 25
Lines 10492 10508 +16
==========================================
+ Hits 8884 8905 +21
+ Misses 1608 1603 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sbSteveK
approved these changes
Jul 14, 2025
xiazhvera
approved these changes
Jul 14, 2025
| struct aws_mqtt5_packet_connect_view connect_options = *options->connect_options; | ||
| if (connect_options.client_id.len == 0) { | ||
| if (options->extended_validation_and_flow_control_options == AWS_MQTT5_EVAFCO_AWS_IOT_CORE_DEFAULTS) { | ||
| /* |
Contributor
There was a problem hiding this comment.
We should update the comments for AWS_MQTT5_EVAFCO_AWS_IOT_CORE_DEFAULTS to mention that the client will generate the client ID. Other than that, the changes look good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
IoT Core creates an invalid (cannot reconnect as) client id when the client uses MQTT5's auto-assigned client id feature. This creates support problems for us since the client cannot reconnect when it should be able to. This PR adds some logic to crudely guess at whether we're using IoT Core (is IoT Core validation turned on, which is the default for builder-created SDK clients) and manually creates a simple client ID in that case, avoiding the reconnect problem.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.