fix(mqtt): an explicit bridge stop cancels a pending late-ack resume
setBridgeState(false) returned early when the bridge was already down, so `set bridge.enabled off` after a timed-out restart left the resume pending and MQTT restarted against the operator's choice once the task acknowledged. Disabling now clears the pending resume before that early return, and the resume also requires bridge_enabled. The StopUnproven log and `get mqtt.status` no longer say only "reboot to recover", since a late ack now recovers on its own. Hardware (Heltec V4, 5 live slots, 1 s test stop deadline): a restart went StopUnproven, the task acknowledged 27 s later and the bridge resumed with all slots reconnecting; with `set bridge.enabled off` in between it stayed stopped until `set bridge.enabled on`.
This commit is contained in:
1 parent
109d7d6128
commit
0b75cb9314
5 files changed
+13
-5
No files matched your search
@@ -1518,7 +1518,8 @@ void MyMesh::loop() {
|
||||
#ifdef WITH_MQTT_BRIDGE
|
||||
// A timed-out stop keeps the bridge down until the MQTT task acknowledges it;
|
||||
// once that late ack lands, restart the bridge that was meant to be running.
|
||||
if (_bridge_resume_pending && bridge && bridge->stopAcknowledgedLate()) {
|
||||
if (_bridge_resume_pending && _prefs.bridge_enabled && bridge &&
|
||||
bridge->stopAcknowledgedLate()) {
|
||||
Serial.println("MQTT: stop acknowledged late - resuming bridge");
|
||||
setBridgeState(true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user