Repository navigation
Conversation
|
Review complete. 🟠 2 high · 🟡 1 medium 💬 Inline comments (3)
The change reworks upload deduplication and the storage recorder contract in
Three issues survived verification: the dedup query references a Reviewed commit: 2a76dcb |
There was a problem hiding this comment.
This PR reworks the presigned-URL upload plugin to deduplicate re-uploads against prior uploaded/processed rows and to require the storage recorder to return a server-allocated S3 key, removing the old delete-and-retry path.
Key findings
- 🟠 Dedup query references
logical_keyno in-repo schema defines — plugin.ts:578 - 🟠 Recorder result unvalidated: undefined or caller-controlled S3 key — storage-file-recorder.ts:67
- 🟡 Re-upload at a custom logical key unique-violates on fixture recorders — plugin.ts:597
A pending upload previously reused a caller-selected object location, allowing unconfirmed content to overwrite a confirmed original or a derived image.
Use the storage recorder's server-allocated physical key for every PUT, projection and response. Dedup only visible confirmed rows by logical_key, bucket and content hash; pending attempts get separate objects. Reject missing/empty/echoed recorder identities before signing. Preserve checksum and upload-id bindings. File-reference URLs now validate derived// children against the readable source row. Update all three storage fixture recorders and HTTP regressions to the same contract.
Coordinated deployment: this is the constructive half of the constructive-db generator/worker/GC change. The production recorder must return id + independent key and files must expose logical_key. Per constructive-db/DEVELOPMENT.md, publish this package first; one subsequent DB PR will combine the generator, regenerated SQL and published dependency bump. No old-key fallback or bucket-policy change is introduced. Existing logical-key replacement authorization remains unchanged.
Validation: