From 5005b13115caedbe0bda9a8496d95d2b4752c62d Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 15 Nov 2026 16:35:37 +0000 Subject: store: counters and the API's placement go by what a read shows Where the policy asks for signed values, a place's value is chosen by `seq`, but two readers still took Automerge's own choice: an increment found the counter beside an envelope a read showed (answering the counter), and `inspect::placed`, which the API's checks go by, walked through whatever Automerge chose. Both now take the value a read shows (`store::shown`). A list's items keep Automerge's choice, as before: no signed value is one, and reading a list whole goes by it. --- src/document/inspect.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/document/inspect.rs') diff --git a/src/document/inspect.rs b/src/document/inspect.rs index f0356de..ffdf536 100644 --- a/src/document/inspect.rs +++ b/src/document/inspect.rs @@ -110,7 +110,8 @@ pub(crate) fn placed(doc: &Document, path: &[String]) -> Path { break; } place = place.child(&Key::Map(key.as_str().into())); - match doc.get(&object, key.as_str()) { + // As a read shows it, of values written there at once (`store::shown`). + match super::store::shown(doc, &object, key.as_str()) { Ok(Some((automerge::Value::Object(kind), id))) => { place.in_list = matches!(kind, automerge::ObjType::List | automerge::ObjType::Text); object = id; -- cgit v1.3.1