Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4841 +/- ##
==========================================
+ Coverage 13.44% 13.49% +0.04%
==========================================
Files 542 543 +1
Lines 17822 17842 +20
Branches 2667 2666 -1
==========================================
+ Hits 2396 2407 +11
- Misses 15104 15112 +8
- Partials 322 323 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This commit refactors `MQTTRepositoryImpl` to improve error handling and code formatting. It replaces generic `Exception` catches with specific MQTT, IO, and Serialization exceptions, ensuring better diagnostic logging and lifecycle management of the client loop.
Specific changes include:
- **Error Handling**: Updated `MQTTRepositoryImpl` to catch specific exceptions (`MQTTException`, `IOException`, `SerializationException`) instead of a generic `Exception` block.
- **Client Logic**:
- Improved address parsing to dynamically select the default port (8883 for TLS, 1883 otherwise).
- Added explicit handling for `CancellationException` in the MQTT client loop.
- **Code Style & Formatting**:
- Applied consistent formatting across `MQTTRepositoryImpl.kt`, `MQTTRepositoryImplTest.kt`, and `MqttJsonPayload.kt`.
- Removed the unused `DEFAULT_QOS` constant.
- Simplified subscription logic and address parsing expressions for readability.
- **Testing**: Updated test files to match new formatting standards while maintaining coverage for address parsing and JSON payload serialization.
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.
Replaces Android only
pahomqtt dependency withKMQTThttps://github.com/davidepianca98/KMQTT.Wired up to Desktop and Android targets for use as client proxy.