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/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/simtest/mod.rs') diff --git a/src/simtest/mod.rs b/src/simtest/mod.rs index d0f80da..d11a402 100644 --- a/src/simtest/mod.rs +++ b/src/simtest/mod.rs @@ -32,8 +32,8 @@ use serde_json::Value as JsonValue; use tokio::time::Instant; use crate::document::replica::Epoch; -use crate::document::store; use crate::document::{ChangeHash, Document}; +use crate::document::{store, view}; use crate::files::Files; use crate::identity::NodeKey; use crate::locks::{MutexExt, RwLockExt}; @@ -482,7 +482,7 @@ pub(crate) fn path(path: &str) -> Vec { /// Writes `value` at `path` (`a/b/c`) as one change, as the API does. pub(crate) async fn write(node: &AppState, at: &str, value: JsonValue) { let at = path(at); - node.mutate_doc(move |doc| store::write_path(doc, &at, &value)) + node.mutate_doc(move |doc| view::write_path(doc, &at, &value)) .await .expect("write"); } -- cgit v1.3.1