BUG: Asset copy duplicates proxy+thumbnail S3 refs — no S3 copy done #60
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 /api/v1/assets/:id/copynow nullsproxy_s3_keyandthumbnail_s3_keyon the new row, setsstatus='processing', and re-queues a proxy generation against the original source. The copy gets its own proxy + thumbnail. Seeservices/mam-api/src/routes/assets.js:301-345.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