enhancement: robust MQTT auto-reconnect with exponential backoff#4963
Open
theKorzh wants to merge 4 commits intomeshtastic:mainfrom
Open
enhancement: robust MQTT auto-reconnect with exponential backoff#4963theKorzh wants to merge 4 commits intomeshtastic:mainfrom
theKorzh wants to merge 4 commits intomeshtastic:mainfrom
Conversation
Collaborator
|
This will need to be rebased onto |
…disconnects. Prevents callbackFlow from closing when collector stops (UI changes, errors, etc.).
b26eca8 to
9ddf973
Compare
Contributor
Author
|
Rebased onto latest main. Should be ready for review now. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4963 +/- ##
==========================================
- Coverage 19.81% 19.76% -0.06%
==========================================
Files 575 575
Lines 18926 18974 +48
Branches 2825 2832 +7
==========================================
Hits 3750 3750
- Misses 14615 14663 +48
Partials 561 561
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Fixes MQTT connection loss without automatic reconnection. Previously, the app made no reconnection attempts after MQTT connection loss. When the connection dropped, the MQTT Proxy would silently stop working, and the app would never attempt to reconnect — requiring users to manually restart the app or reconnect node. This PR implements a infinite reconnection retry loop with exponential backoff.
Why This Implementation Is Necessary
The KMQTT library does NOT have built-in auto-reconnect functionality.
As confirmed by the library owner in issue #51:
This PR provides the auto-reconnect functionality that the library itself does not yet offer.
Possible fixes: #4016 and related MQTT reconnection issues.