Fixes wrong QoS condition in publish message flow in mqtt-streaming c… #1582
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.
…onnector.
Pull Request Checklist
Fixes
Fixes wrong QoS condition in publish message flow in mqtt-streaming connector. There's no functional change. Actually old code was working properly even when the check was incorrect by chance since the boolean check evaluates true for both contants
ControlPacketFlags.QoSAtMostOnceDelivery
andControlPacketFlags.QoSExactlyOnceDelivery
when message QoS is 2. However the code is misleading and doesn't reflect its real intention which is verify the QoS is "exactly once delivery" instead of "at most once delivery"Purpose
Substitute wrong QoS check by the correct one so that code express its intention beyond following the MQTT spec.
Background Context
Simple change it is only a wrong constant value and used the right one.
References
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html