BUG: proxy.js worker sets status='error' on failure at end — overrides existing live/ingesting status #79

Closed
opened 2026-05-25 06:35:43 -04:00 by zgaetano · 0 comments
Owner

Bug

services/worker/src/workers/proxy.js in the catch block:

await query(
  `UPDATE assets SET status = 'error', updated_at = NOW() WHERE id = $1`,
  [assetId]
);

And at the end of the finally block.

Problem

If the proxy job was queued for a live asset (which happens — POST /assets queues proxy for live assets that have original_s3_key), and the proxy job fails, it sets status to error. But a live asset isn't "errored" — it's still being recorded. The live status should be preserved.

Impact

  • During a recording, if someone triggers a proxy job on the live asset (via POST /:id/generate-proxy), a proxy failure would erroneously mark the live recording as error
  • The recorder's current session is unaffected but the asset row is corrupted

Location

services/worker/src/workers/proxy.js:174-176

Fix

Only set status = 'error' when current status isn't 'live' or 'ingesting':

await query(
  `UPDATE assets SET status = CASE WHEN status IN ('live','ingesting') THEN status ELSE 'error' END, updated_at = NOW() WHERE id = $1`,
  [assetId]
);
## Bug `services/worker/src/workers/proxy.js` in the `catch` block: ```js await query( `UPDATE assets SET status = 'error', updated_at = NOW() WHERE id = $1`, [assetId] ); ``` And at the end of the `finally` block. ## Problem If the proxy job was queued for a `live` asset (which happens — `POST /assets` queues proxy for live assets that have `original_s3_key`), and the proxy job fails, it sets status to `error`. But a `live` asset isn't "errored" — it's still being recorded. The live status should be preserved. ## Impact - During a recording, if someone triggers a proxy job on the live asset (via `POST /:id/generate-proxy`), a proxy failure would erroneously mark the live recording as `error` - The recorder's current session is unaffected but the asset row is corrupted ## Location `services/worker/src/workers/proxy.js:174-176` ## Fix Only set `status = 'error'` when current status isn't `'live'` or `'ingesting'`: ```js await query( `UPDATE assets SET status = CASE WHEN status IN ('live','ingesting') THEN status ELSE 'error' END, updated_at = NOW() WHERE id = $1`, [assetId] ); ```
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#79
No description provided.