pub async fn open_representation<S, K, H>(
source: &S,
asset: &AssetBlobs,
desired: Representation,
locally_held: &BTreeSet<Representation>,
keys: &K,
on_authorization_change: H,
) -> FetchResolutionExpand description
Fetch desired for an asset, applying the degrade ladder on failure.
Before any byte moves, a thumbnail or preview is resolved against its signed manifest
in AssetBlobs::derivative_manifests:
format = "original"→FetchResolution::ReferencesOriginal, no fetch.- a format outside the closed still set, or no AMK epoch →
DegradeReason::ManifestRejected, no fetch (the receiver half of the tier table’s “every receiver comparesDerivativeManifest.formatagainst this list”). - no manifest committing to the blob the feed names →
DegradeReason::NoManifest. - an epoch
keysdoes not hold →DegradeReason::KeyUnavailable.
Then the blob is fetched:
- Success →
FetchResolution::Opened(a derivative, decrypted) orFetchResolution::Fetched(the original, still ciphertext). - AEAD failure on a derivative → the copy is discarded,
DegradeReason::Corrupt. 403→ invokeon_authorization_change(re-sync membership/capability), retry once; if it still fails,FetchResolution::DegradedwithDegradeReason::AuthorizationChanged(a revocation surfaced as such, not masked as a missing file).410/purged →FetchResolution::Degraded/DegradeReason::PermanentlyGone.pending_upload→FetchResolution::Pending.- transient →
FetchResolution::Degraded/DegradeReason::TemporarilyUnavailable(the asset stays listed and re-fetches automatically later).
The degrade target is best_available over locally_held, so it steps down
preview → thumbnail → LQIP. The asset’s metadata / index entry is never removed
— degrade only changes what is shown.