aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-15 16:33:22 +0000
committertv <tv@krebsco.de>2026-11-15 16:33:22 +0000
commitb8c3c1a5adaa2a64fc17bd89a943ccf1ad386373 (patch)
tree3bb9bf2580932cadd3d0eb724d5343c55ff1f0fa /docs/api.md
parentb0d68ad3b99aa06029f30d7dc45455108b52dadc (diff)
store: values ordered by seq only where the policy asks for signed values
The order by `seq` sat in `store::candidates`, which every swarm reads through: in a swarm that isn't strict, a string shaped like an envelope, written at the same time as a plain value or a map, was read first. What a swarm without a strict policy reads must not change for signed values. The order now applies only where the policy asks for signed values (`"values": "signed"`), as any value at the policy's place says, read as written (`signs_values`), so the policy's own reading doesn't go round. Elsewhere `candidates` is newest first, as always. It is looked at only where a place holds several values and one is an envelope.
Diffstat (limited to 'docs/api.md')
-rw-r--r--docs/api.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/api.md b/docs/api.md
index 41a4f4d..a839f74 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -164,8 +164,10 @@ way on every node:
* **The same key**: one write wins, the same one everywhere. "Newest" means by
Automerge's operation order (the write made after seeing more changes; between equals,
by the writer's actor ID), not by any clock: of two truly concurrent writes, which wins
- is arbitrary, but it is the same on every node. Values their users signed come first
- (Signed values, below): of those, the one its user numbered highest (`seq`).
+ is arbitrary, but it is the same on every node. Where the swarm's policy asks for
+ signed values (Signed values, below), a string that is an envelope comes before
+ anything else written there at once, a map too: of those, the one its user numbered
+ highest (`seq`), of equal ones the one with the lower SHA-256.
* **Maps written at the same key** merge into one: their keys are united, each key as
above.
* **A write and a delete** of the same key: the write stays (a delete removes only what