MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / ingest_session_manifest

Method ingest_session_manifest

atomic-repository/src/repository/changes.rs:394–408  ·  view source on GitHub ↗

Store a session manifest received from another repository. Idempotent: storing the same content hash twice is a no-op. The convenience head advances to this manifest for its session ID.

(
        &self,
        manifest: &atomic_core::change::session::SessionManifest,
    )

Source from the content-addressed store, hash-verified

392 /// Idempotent: storing the same content hash twice is a no-op. The
393 /// convenience head advances to this manifest for its session ID.
394 pub fn ingest_session_manifest(
395 &self,
396 manifest: &atomic_core::change::session::SessionManifest,
397 ) -> Result<Hash, RepositoryError> {
398 let mut txn = self
399 .pristine
400 .write_txn()
401 .map_err(|e| RepositoryError::Database(e.to_string()))?;
402 let hash = txn
403 .save_session_manifest(manifest)
404 .map_err(|e| RepositoryError::Database(e.to_string()))?;
405 txn.commit()
406 .map_err(|e| RepositoryError::Database(e.to_string()))?;
407 Ok(hash)
408 }
409
410 /// Rebuild session indexes from stored provenance graphs.
411 ///

Calls 3

write_txnMethod · 0.80
save_session_manifestMethod · 0.80
commitMethod · 0.80