Skip to main content

synced_history_sources

Function synced_history_sources 

Source
pub fn synced_history_sources(
    manifest_cbor: Vec<u8>,
    history: Vec<Vec<u8>>,
) -> Result<FfiHistorySources, FfiError>
Expand description

Name what adopting an asset from its history fetches: the live metadata blob and the original, read off the asset’s latest record manifest_cbor (a feed entry’s) and history, the records before it that FfiSession::fetch_provenance_history returned.

An album page — the one a writer member’s device reads — serves a delete with no metadata blob and no blob, so a device that first sees the asset there has only its records. The live metadata blob is the newest record that binds one, and the delete commits to the original; the server serves both to the asset’s readers until its retention window closes. Fetch them with FfiSession::fetch_metadata_blob and FfiSession::fetch_blob_to_path, set the entry’s metadata_blob to the first, and hand the second to FfiWorkspace::open_synced_history: the asset is held in this device’s trash and its trash-restore can be signed. An entry that names its metadata blob (the owner’s own feed) agrees with this answer.

Pure and offline. Nothing is trusted for being named: the adoption binds the metadata blob and the original to the records, and refuses what does not.

§Errors

FfiError::Sync when a record does not decode or none binds a metadata blob.