BUG: POST /assets/batch-trim creates jobs table row with wrong job_type — no matching pg_enum value #70

Closed
opened 2026-05-25 05:34:41 -04:00 by zgaetano · 1 comment
Owner

Fixed in migration 016-fix-job-type-enum.sql — added expires_at column to jobs with 24h TTL on trim rows, and added the missing enum values so the inserted job_type matches reality. See #75 / #90.

Fixed in migration `016-fix-job-type-enum.sql` — added `expires_at` column to `jobs` with 24h TTL on trim rows, and added the missing enum values so the inserted job_type matches reality. See #75 / #90.
Author
Owner

Fix Plan — #70 batch-trim creates jobs row with wrong job_type

Root cause: batch-trim creates a jobs row with type 'trim' and status 'queued'. The in-database jobs row for trim jobs has no associated BullMQ job ID visible in /jobs. If trim job fails, the jobs row stays 'queued' forever.

Fix: Either make jobs.js also query the DB jobs table (UNION with BullMQ state), or remove the INSERT in batch-trim entirely and track status purely via temp_segments.

Files: src/routes/assets.js (batch-trim), src/routes/jobs.js
Effort: ~1h
**Priority: P2 — data consistency

## Fix Plan — #70 batch-trim creates jobs row with wrong job_type **Root cause:** batch-trim creates a jobs row with type 'trim' and status 'queued'. The in-database jobs row for trim jobs has no associated BullMQ job ID visible in /jobs. If trim job fails, the jobs row stays 'queued' forever. **Fix:** Either make jobs.js also query the DB jobs table (UNION with BullMQ state), or remove the INSERT in batch-trim entirely and track status purely via temp_segments. **Files:** src/routes/assets.js (batch-trim), src/routes/jobs.js **Effort:** ~1h **Priority: P2 — data consistency
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#70
No description provided.