BUG: POST /assets with status=live asset already existing: captures registered as processing overwrite the live asset #63
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 in migration
017-live-asset-unique-index.sql— partial unique index on(project_id, display_name) WHERE status='live'prevents the silent overwrite. The INSERT now fails with a 409-style unique-constraint violation when two captures collide.Fix Plan — #63 POST /assets race: processing overwrites live asset
Root cause: Two simultaneous captures for same projectId + clipName can both find the same live row and both UPDATE it. Second capture overwrites first S3 keys.
Fix — add partial unique index:
This makes the second INSERT fail with a unique violation (caught as 409). The capture container should retry with a new clipName or wait.
Files: migration SQL, src/routes/assets.js POST handler
Effort: ~30min
**Priority: P2 — data integrity