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

Method was_change_applied

atomic-core/src/pristine/applied_changes.rs:81–109  ·  view source on GitHub ↗

Whether canonical effects were ingested, independently of current view membership or vertex ownership. Registration alone is insufficient. Legacy read-only databases derive evidence once per transaction without modifying the database; writable opens persist the derived index.

(&self, id: NodeId)

Source from the content-addressed store, hash-verified

79 /// Legacy read-only databases derive evidence once per transaction without
80 /// modifying the database; writable opens persist the derived index.
81 pub fn was_change_applied(&self, id: NodeId) -> PristineResult<bool> {
82 if id.is_root() {
83 return Ok(false);
84 }
85 match self.txn.open_table(APPLIED_CHANGES) {
86 Ok(index) => {
87 if index.get(id.get())?.is_some() {
88 return Ok(true);
89 }
90 self.has_change_in_graph(id)
91 }
92 Err(TableError::TableDoesNotExist(_)) => {
93 if self.legacy_applied_changes.get().is_none() {
94 let ids = canonical_effect_writers(
95 &self.txn.open_multimap_table(GRAPH)?,
96 &self.txn.open_multimap_table(POSITION_ATTRS)?,
97 &self.txn.open_table(VIEW_CHANGES)?,
98 )?;
99 let _ = self.legacy_applied_changes.set(ids);
100 }
101 Ok(self
102 .legacy_applied_changes
103 .get()
104 .expect("initialized above")
105 .contains(&id.get()))
106 }
107 Err(error) => Err(error.into()),
108 }
109 }
110}
111
112impl WriteTxn<'_> {

Callers 10

publishMethod · 0.80
loadMethod · 0.80
insert_changeMethod · 0.80

Calls 7

canonical_effect_writersFunction · 0.85
is_noneMethod · 0.80
getMethod · 0.65
is_rootMethod · 0.45
has_change_in_graphMethod · 0.45
setMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected