fix(CommunicationRouter): republish status/playback on every MQTT (re)connect (F-066)

status/playback is retained but was only published on a Player transition.
After a power loss mid-melody the Player boots straight into STOPPED with no
transition, so the broker kept serving the old "playing" forever. The
MQTT on-connect callback now publishes Player::getPlaybackSnapshot() on
every CONNECT (not just the first after boot) — "idle" after a reboot, the
live state after a plain reconnect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 20:11:20 +03:00
co-authored by Claude Opus 5.5
parent fe5ab6223c
commit 92a0a8d5e8
4 changed files with 29 additions and 2 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ to `status/heartbeat` (QoS 1, retained), overwriting the last "online" heartbeat
**QoS:** 1 — **Retained:** yes — **Switch:** `playback` — **Trigger:** playback state transition only
Published by `Player::setStatus()` on every transition (not polled). This topic — not the `control/ack` reply — is the source of truth for what the board is actually doing. Skipped (not queued) while free heap is below the publish guard.
Published by `Player::setStatus()` on every transition (not polled), **and on every MQTT connect/reconnect** with the Player's current real state — so a retained `playing` left behind by a power loss mid-melody is overwritten (normally with `idle`) as soon as the board is back. This topic — not the `control/ack` reply — is the source of truth for what the board is actually doing. Skipped (not queued) while free heap is below the publish guard.
### Payload