Silence ERROR log for status messages from deleted nodes

_handle_status was calling doc_update unconditionally, which throws a 404
when a node has been deleted from the UI but is still running and sending
heartbeats. Catch the "No document to update" error and log at info level
instead of bubbling up to the dispatch error handler.
This commit is contained in:
Logan
2026-06-01 01:06:49 -04:00
parent cbcc85f7b1
commit 683b05beb1
+10 -4
View File
@@ -127,10 +127,16 @@ class MQTTHandler:
status = payload.get("status")
if not status:
return
await fstore.doc_update("nodes", node_id, {
"status": status,
"last_seen": datetime.now(timezone.utc).isoformat(),
})
try:
await fstore.doc_update("nodes", node_id, {
"status": status,
"last_seen": datetime.now(timezone.utc).isoformat(),
})
except Exception as e:
if "No document to update" in str(e):
logger.info(f"Status from deleted/unknown node {node_id} — ignoring (no Firestore doc)")
else:
raise
# ------------------------------------------------------------------
# Metadata — call_start / call_end events