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

Method get_session_events

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

Get the full ordered replay log for a provenance graph. Returns all session events ordered by sequence number, for provenance from any agent. Empty only if the graph has no nodes / no session data.

(
        &self,
        provenance_hash: &Hash,
    )

Source from the content-addressed store, hash-verified

1760 /// Returns all session events ordered by sequence number, for provenance
1761 /// from any agent. Empty only if the graph has no nodes / no session data.
1762 pub fn get_session_events(
1763 &self,
1764 provenance_hash: &Hash,
1765 ) -> Result<Vec<atomic_core::change::session::SessionEvent>, RepositoryError> {
1766 let txn = self
1767 .pristine
1768 .read_txn()
1769 .map_err(|e| RepositoryError::Database(e.to_string()))?;
1770 let provenance_id = txn
1771 .get_internal(provenance_hash)
1772 .map_err(|e| RepositoryError::Database(e.to_string()))?
1773 .ok_or_else(|| RepositoryError::ChangeNotFound {
1774 hash: provenance_hash.to_base32(),
1775 })?;
1776 txn.get_session_events(provenance_id.get())
1777 .map_err(|e| RepositoryError::Database(e.to_string()))
1778 }
1779
1780 /// Get all todos for a provenance graph.
1781 ///

Callers 1

has_session_dataMethod · 0.45

Calls 4

read_txnMethod · 0.80
getMethod · 0.65
get_internalMethod · 0.45
to_base32Method · 0.45

Tested by

no test coverage detected