diff options
| author | tv <tv@krebsco.de> | 2026-11-15 16:35:37 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-15 16:35:37 +0000 |
| commit | 5005b13115caedbe0bda9a8496d95d2b4752c62d (patch) | |
| tree | 4930791a171f61745c4ecc798bb09ff6be22acab /src/document/inspect.rs | |
| parent | b8c3c1a5adaa2a64fc17bd89a943ccf1ad386373 (diff) | |
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.
Diffstat (limited to 'src/document/inspect.rs')
| -rw-r--r-- | src/document/inspect.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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; |
