← All updates

Enhance jobs that failed to start no longer poll forever

An enhanced PDF whose upload or queue hand-off failed could leave a job stuck at "queued" that a retry polled forever. API-key and signed-in submissions now report the failure straight away, wallet-paid jobs are swept to failed by the daily watchdog, and a cancelled job stays cancelled.

enhanceapix402fixes

Submitting a PDF to POST /api/v1/enhance could leave the job stuck at status: "queued" if the file upload to storage or the hand-off to the processing queue failed. A retry with the same Idempotency-Key returned that dead job as a normal 202, and polling GET /api/v1/enhance/jobs/:id never reached a terminal status.

Those failures now mark the job failed straight away for API-key and signed-in callers, so polling reaches a terminal status instead of hanging. Wallet-paid (x402) submissions are different: their producer leaves the row queued when the upload or enqueue fails, and the daily watchdog sweeps queued rows older than two hours to failed, marking the payment failed at the same time. A retry with the same Idempotency-Key now returns that failed job rather than one stuck at queued; to submit the same document again, send a new Idempotency-Key, or leave the header off.

One smaller fix in the same area: cancelling a job is now final. A queue message that arrived after the cancel could previously put the job back into processing and run it anyway — it now stays cancelled.