Sync Contract
:::info Source
Sourced from services/media-service/SYNC_CONTRACT.md in the documentation repo.
:::
1. Applicability
Media assets are referenced by bundles; bundle blobs (encrypted) travel offline. Metadata replicable for offline preview.
2. Registration
{ service: 'media', entityType: 'MediaAsset', conflictPolicy: 'server_authoritative', deltaProjector: 'assets_by_owner', pushHandler: 'none', versionField: 'updatedAt', schemaRef: 'schemas://media/asset/v1' }
Caption tracks and transcripts are included in PlayPackage bundles (content-service), not directly synced.
3. Offline Behavior
- Media assets embedded in bundles travel with the bundle (encrypted).
- Non-bundled assets (author workspace) require online to view.
- Caption tracks bundled with video for offline playback.
4. Security
- Bundle encryption (content-service) protects assets at rest on device.
- Signed URLs never cached in client.
5. LocalStore
assets_view: (id PK, kind, mime, thumbnailUrl?, ready, updatedAt)
Thumbnails cached with 7-day TTL.
6. Cursor
Scope media:user:{userId} for author workspace.