#475 Race Condition: File deduplication missing ON CONFLICT
Description
Editengine/services/storage_service.py:114-131
File store deduplication has TOCTOU race:
1. Store file in S3
2. Check if storage_ref exists in DB
3. Insert if not exists
Race: Two threads store same file, both check DB, both insert -> duplicate key error.
FIX: Use INSERT ... ON CONFLICT (storage_ref) DO NOTHING RETURNING file_id
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...