BUG: POST /assets/:id/mark-empty requires status=live — but capture shutdown may pass wrong assetId #66
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixed —
POST /:id/mark-emptynow reads the asset's current status first, no-ops idempotently when already terminal (error/ready), accepts bothliveandprocessing(handles the capture-shutdown race), and returns 409 with the offending status for any other state. Seeservices/mam-api/src/routes/assets.js:347-376.Fix Plan — #66 mark-empty requires status=live but capture may crash first
Root cause: Two scenarios: (1) capture container crashes before calling mark-empty, asset stays status=live forever; (2) asset_id passed to capture container may not match.
Fix — add automatic cleanup to scheduler tick:
Also: ensure capture container always calls mark-empty on shutdown (SIGTERM handler in capture).
Files: src/scheduler.js, capture service
Effort: ~1h
**Priority: P2 — stale state cleanup