Skip to the content.

Deletion sequence

Undo is a client delay, not server soft delete. SQLite cascade is transactional inside the adapter; Dynamo deletes parent first then sweeps. Catalog, object deletion, audit and invalidation are not one transaction. An exception after parent removal can leave partial cleanup; the diagram shows successful ordering and must not be read as guaranteed rollback.

Legend: all drawn relationships are source-verified; branches are conditional execution paths. No inferred service is drawn.

sequenceDiagram
  actor U as Admin user
  participant UI as Admin media page
  participant R as Selected authenticated API
  participant L as MediaLibrary
  participant C as Catalog and jobs
  participant B as Blob store
  participant A as Audit store
  participant F as CloudFront
  U->>UI: Confirm delete
  UI->>UI: Hide row, offer Undo for 8 seconds
  alt Undo selected
    UI->>UI: Restore snapshot without DELETE
  else Commit deletion
    UI->>R: Bearer DELETE asset
    R->>L: deleteAsset(id)
    L->>C: Read asset, jobs and children
    alt Fresh running materialization lease
      L-->>R: MediaConflictError (409)
      R-->>UI: Failure, restore UI snapshot
    else Delete allowed
      L->>C: Delete parent and cascade children/jobs
      L->>C: Sweep remaining children/jobs
      L->>B: Delete collected original and variant keys
      L->>A: Append asset.deleted
      opt AWS distribution configured
        L->>F: Invalidate deleted paths
      end
      L-->>R: Complete
      R-->>UI: Deleted id
    end
  end

Source evidence