BUG: Batch-trim DB jobs row is orphaned — no status lifecycle, job_type enum is stale #90
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 via migration 016 —
jobs.expires_atTTL ensures batch-trim rows don't sit orphaned, and the trim worker writescompleted/failedstatus correctly now thatjob_statushas thecompletedenum value. See #75, #70.BUG: Trim jobs invisible in Jobs screen — inserted into DBto BUG: Batch-trim DBjobstable but screen reads BullMQ onlyjobsrow is orphaned — no status lifecycle,job_typeenum is stalezgaetano referenced this issue2026-05-26 01:31:48 -04:00
job_typeandjob_statusenums don't match —jobs.jsDB table usesjob_typeENUM with missing values #75Fix Plan — #90 Batch-trim DB jobs row orphaned
Root cause:
assets.js:batch-trimINSERTs a row intojobsDB table with type"trim"status"queued", butjobs.jsGET route reads exclusively from BullMQ queues — never fromjobsDB table. The DB row is invisible and permanent.Fix (choose one):
Option A: Make
jobs.jsalso query thejobsDB table, UNION with BullMQ state. Show combined status.Option B (simpler): Stop writing to
jobsDB table inbatch-trim. Track status purely via BullMQ job state +temp_segmentstable. Remove the dead INSERT.Also fix:
temp_segments.job_idFK →ON DELETE CASCADEneeds the actual BullMQ job ID or the DBjobs.idto match what gets inserted.Files:
src/routes/assets.js(batch-trim handler),src/routes/jobs.jsEffort: ~1.5h
**Priority: P2 — data consistency
POST /assets/batch-trimcreatesjobstable row with wrong job_type — no matching pg_enum value #70