fix: MQTT proxy connection and probe test failures (#5215)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
This commit is contained in:
James Rich
2026-04-22 11:05:24 -05:00
committed by GitHub
parent ae610bbba5
commit 3f7cbaee7e
2 changed files with 11 additions and 7 deletions

View File

@@ -44,6 +44,7 @@ import org.meshtastic.mqtt.ProbeResult
import org.meshtastic.mqtt.probe
import org.meshtastic.proto.MqttClientProxyMessage
import org.meshtastic.proto.ToRadio
import kotlin.time.Clock
@Single
class MqttManagerImpl(
@@ -125,6 +126,8 @@ class MqttManagerImpl(
val endpoint = resolveEndpoint(address, tlsEnabled)
val result =
MqttClient.probe(endpoint = endpoint) {
// Provide a valid client ID for the probe; brokers reject empty identifiers
clientId = "MeshtasticProbe-${Clock.System.now().toEpochMilliseconds()}"
val user = username?.takeUnless { it.isEmpty() }
val pass = password?.takeUnless { it.isEmpty() }
if (user != null) this.username = user