BUG: Asset copy duplicates proxy+thumbnail S3 refs — no S3 copy done #60

Closed
opened 2026-05-25 02:56:35 -04:00 by zgaetano · 1 comment
Owner

Fixed — POST /api/v1/assets/:id/copy now nulls proxy_s3_key and thumbnail_s3_key on the new row, sets status='processing', and re-queues a proxy generation against the original source. The copy gets its own proxy + thumbnail. See services/mam-api/src/routes/assets.js:301-345.

Fixed — `POST /api/v1/assets/:id/copy` now nulls `proxy_s3_key` and `thumbnail_s3_key` on the new row, sets `status='processing'`, and re-queues a proxy generation against the original source. The copy gets its own proxy + thumbnail. See `services/mam-api/src/routes/assets.js:301-345`.
Author
Owner

Fix Plan — #60 Asset copy duplicates S3 refs

Root cause: POST /:id/copy in assets.js copies proxy_s3_key and thumbnail_s3_key from source to new asset row, but does NOT copy actual S3 objects. Both assets reference same keys. Delete one with hard=true → S3 objects deleted → other asset URLs break.

Fix (choose one):

Option A (deep copy): After copying asset row, copy S3 objects with new keys. Use s3Client.copyObject() to create independent copies, update new asset row with new keys.

Option B (regenerate): Set proxy/thumbnail keys to NULL on copy, queue regeneration via BullMQ proxy and thumbnail queues.

Option C (shared refs, no delete): Allow shared refs but skip S3 delete when other assets reference same key. Requires a ref-count column on S3 keys.

Files: src/routes/assets.js (copy handler)
Effort: ~1.5h
**Priority: P2 — data integrity

## Fix Plan — #60 Asset copy duplicates S3 refs **Root cause:** POST /:id/copy in assets.js copies proxy_s3_key and thumbnail_s3_key from source to new asset row, but does NOT copy actual S3 objects. Both assets reference same keys. Delete one with hard=true → S3 objects deleted → other asset URLs break. **Fix (choose one):** **Option A (deep copy):** After copying asset row, copy S3 objects with new keys. Use s3Client.copyObject() to create independent copies, update new asset row with new keys. **Option B (regenerate):** Set proxy/thumbnail keys to NULL on copy, queue regeneration via BullMQ proxy and thumbnail queues. **Option C (shared refs, no delete):** Allow shared refs but skip S3 delete when other assets reference same key. Requires a ref-count column on S3 keys. **Files:** src/routes/assets.js (copy handler) **Effort:** ~1.5h **Priority: P2 — data integrity
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#60
No description provided.