1.0 KiB
1.0 KiB
Feature Plan: Media Asset Normalization
Goal
Normalize media into reusable assets so messages reference media IDs rather than duplicate transport blobs.
Why This Fits GIA
- GIA already has shared media prep and cross-transport relay.
- Normalized assets reduce duplicate downloads/uploads and improve traceability.
Scope
- New
MediaAssetentity with checksum + metadata. - New link table between
MessageandMediaAsset. - De-dup by
sha256and file size.
Implementation
- Add models/migrations:
MediaAsset,MessageMediaRef. - Update inbound media ingestion to upsert
MediaAsset. - Update outbound transport prep to consume
MediaAssetreferences. - Add background backfill for existing attachments.
- Add retention/GC strategy for orphaned assets.
Acceptance Criteria
- Same file across transports resolves to one
MediaAsset. - Message records keep only pointers and display metadata.
- Relay path can reuse existing asset without re-download.
Out of Scope
- External CDN migration in this phase.