ServerMqttManager received MQTT messages and passed the payload to the message handler using
message.payload.toString(). In Kotlin/JVM, ByteArray.toString() returns the JVM object
reference string ([B@1cb85350), not the UTF-8 text content. Every inbound MQTT SUB message
therefore stored a garbage heap-address string into the snapshot and connected DataPoints, making
the full external publisher → MQTT SUB → DataPoint → automation path produce junk downstream.
The bug was visible in logs: the line above the broken call already decoded correctly with
String(message.payload) for logging purposes, but the handler invocation did not.
Introducing commit: ad3d0b6c7 mqtt working.
server/src/jvmMain/kotlin/.../mqtt/ServerMqttManager.kt line 66:
changed message.payload.toString() → String(message.payload, Charsets.UTF_8).ByteArray.toString() in Kotlin/JVM never produces the byte content — it always produces the
JVM object reference. Prefer String(byteArray, Charsets.UTF_8) (or .decodeToString())
wherever a ByteArray must be interpreted as text.String(message.payload)) but the adjacent
production call does not, that is a strong signal the log was written first and the handler
call was copy-pasted without the same care.MqttMessage with known text, round-trips through
the decode path, and asserts equality — no broker connection required.