Add job_event and job_event_ack to the gateway protocol

A gateway keeps what happened to a job it was handed (started, finished,
failed) and re-sends it on every connection until the cloud acknowledges
it, so an outcome reached while the cloud was unreachable still arrives.
This commit is contained in:
2026-10-30 08:05:04 +00:00
parent 2bc5b88dd7
commit b8462f25fc
3 changed files with 49 additions and 0 deletions
@@ -195,6 +195,20 @@
},
"required": ["type", "request_id"]
},
{
"type": "object",
"title": "JobEvent",
"description": "What happened to a job this gateway was handed, kept in the gateway's own database and re-sent on every connection until the cloud answers with a JobEventAck - so an outcome reached while the cloud was unreachable (or the gateway restarted) still arrives. The cloud applies it only to a job that is still in flight, so a job it has since cancelled or reassigned is left alone, and applying the same event twice changes nothing.",
"properties": {
"type": { "const": "job_event" },
"event_id": { "type": "integer", "description": "The gateway's own sequence number for this event; echoed in the JobEventAck." },
"job_id": { "type": "string", "format": "uuid" },
"event": { "enum": ["started", "finished", "failed"] },
"detail": { "type": ["string", "null"], "description": "For failed: the reason, in words for an operator." },
"at_ms": { "type": "integer", "description": "When the gateway observed it, milliseconds since the Unix epoch." }
},
"required": ["type", "event_id", "job_id", "event", "at_ms"]
},
{
"type": "object",
"title": "DiscoveredPrinters",