diff --git a/drb-c2-core/app/internal/mqtt_handler.py b/drb-c2-core/app/internal/mqtt_handler.py index ff5b8a8..c4b9b84 100644 --- a/drb-c2-core/app/internal/mqtt_handler.py +++ b/drb-c2-core/app/internal/mqtt_handler.py @@ -104,9 +104,13 @@ class MQTTHandler: "lat": payload.get("lat", existing.get("lat", 0.0)), "lon": payload.get("lon", existing.get("lon", 0.0)), } - # Only promote to online if already configured (don't overwrite explicit status) - if existing.get("configured") and existing.get("status") not in ("recording",): - updates["status"] = "online" + # Update status on checkin (don't clobber an active recording) + if existing.get("status") not in ("recording",): + if existing.get("configured"): + updates["status"] = "online" + elif existing.get("approval_status") == "approved": + # Approved but not yet configured — restore reachable status after reboot + updates["status"] = "unconfigured" await fstore.doc_update("nodes", node_id, updates) # NOTE: discord_connected in checkins is informational only — do NOT release the