Show when a job was first sent to the printer
A failed job's error is its last attempt's, so it cannot say whether an earlier attempt wrote part of the receipt: a first attempt cut off by a write error and a second that fails to dial end with a dial error. Job status now has sent_at, the time the first attempt was about to write to the printer, taken from the delivery's first sending mark. A failed job with sent_at reached the printer and may have printed in part; one without it never did. Part of stage 1c of docs/plans/job-store.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7e6cda16f8
commit
9b25c1bfd3
6 files changed
+89
-9
No files matched your search
+5
-1
@@ -118,12 +118,16 @@ curl -H @"$HOME/.uberbringer-auth" https://printer.example.com/api/v1/jobs/job_0
|
||||
"attempts": 1,
|
||||
"created_at": "2026-11-29T21:04:05Z",
|
||||
"started_at": "2026-11-29T21:04:05Z",
|
||||
"sent_at": "2026-11-29T21:04:05Z",
|
||||
"finished_at": "2026-11-29T21:04:06Z"
|
||||
}
|
||||
```
|
||||
|
||||
`status` is `queued`, `printing`, `done` or `failed`. A failed job includes an
|
||||
`error` field. `source` says where the job came from: `print` for
|
||||
`error` field. `sent_at` is when the first attempt was about to write to the
|
||||
printer. A failed job with `sent_at` reached the printer, and part of it may
|
||||
have printed; one without it never reached the printer.
|
||||
`source` says where the job came from: `print` for
|
||||
`/api/v1/print`, `module:<name>` for a [module](#modules) route, or
|
||||
`ntfy:<name>` for an [ntfy subscription](ntfy.md)
|
||||
in the config. The last `queue.history` finished jobs are kept.
|
||||
|
||||
@@ -413,6 +413,11 @@
|
||||
"pattern": "^job_[0-7][0-9a-hjkmnp-tv-z]{25}$",
|
||||
"type": "string"
|
||||
},
|
||||
"sent_at": {
|
||||
"description": "sent_at is when the first attempt was about to write to the printer. A failed job with sent_at reached the printer, and part of it may have printed; one without it never reached the printer.",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"source": {
|
||||
"description": "source says where the job came from: print for POST /api/v1/print, module:<name> for a module route, e.g. module:ntfy, or ntfy:<subscription> for an ntfy subscription in the config.",
|
||||
"type": "string"
|
||||
|
||||
Reference in new issue
Block a user