From e63d30c2581033a85489b10c3f5b252fdbb5049e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 03:21:43 +0000 Subject: state: plain writes take a view to write, Automerge's are asked for as such AppState::mutate_doc, mutate_doc_registering and mutate_doc_by hand what they are given a document::view::Write: the member registry, the users, sessions, forgetting and bootstrap write through them, and take whatever kind of document gives it. AppState::mutate_doc_for is for what asks more of an Automerge document than values at paths (the store's API, a remake's host, a store's events), and gives the heads after the write. What reads a view takes one of any size (dyn Write among them). --- src/simtest/remakes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/simtest/remakes.rs') diff --git a/src/simtest/remakes.rs b/src/simtest/remakes.rs index 6fa4235..49139b6 100644 --- a/src/simtest/remakes.rs +++ b/src/simtest/remakes.rs @@ -17,7 +17,7 @@ use serde_json::{Value as JsonValue, json}; use super::{SOON, Sim, read, write}; use crate::document::ChangeHash; use crate::document::replica::Epoch; -use crate::document::store; +use crate::document::view; use crate::remake::testing; use crate::state::AppState; use crate::swarm::bootstrap::Start; @@ -257,7 +257,7 @@ async fn writes_through_a_rejoin_are_kept() { while !stop.load(Ordering::Relaxed) { let at = vec!["w".to_owned(), n.to_string()]; let written = c - .mutate_doc(move |doc| store::write_path(doc, &at, &json!(n))) + .mutate_doc(move |doc| view::write_path(doc, &at, &json!(n))) .await; assert!(written.is_ok(), "write {n} refused: {written:?}"); answered.lock().unwrap().push(n); -- cgit v1.3.1