aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-29 15:06:04 +0000
committertv <tv@krebsco.de>2026-11-29 15:06:04 +0000
commit8cdde74fcdcf31414da0d22222d2cc338df20fa1 (patch)
tree37911374599ed825fa3264c8e99ae830cec843fc /src/document
parenta3af68fafee80b3eef493e8b041e21352e547da2 (diff)
wire: what another kind of document says, in a SYNC's body and a STATUS's stamp
From version 53 on, beside Automerge's (SyncBody::Kind, HeadsSummary::Kind): a SYNC's body is one more of its shapes, another kind's bytes; a STATUS's stamp is another kind's bytes after a byte no Automerge stamp begins with. Nothing version 53 said changes, and version 52 says neither (WireError::OtherKind). Two stamps of another kind are the same where their bytes are. A node holding an Automerge document passes over a body of another kind: a peer holding one isn't let near it.
Diffstat (limited to 'src/document')
-rw-r--r--src/document/passing.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/document/passing.rs b/src/document/passing.rs
index 0b9a3dd..dc116e3 100644
--- a/src/document/passing.rs
+++ b/src/document/passing.rs
@@ -194,6 +194,7 @@ pub(crate) fn carried_bytes(body: &SyncBody) -> Option<usize> {
SyncBody::Message(payload) | SyncBody::Deflated(payload) => Some(payload.0.len()),
SyncBody::Changes { changes, .. } => Some(changes.iter().map(|change| change.len()).sum()),
SyncBody::Delta(_) => None,
+ SyncBody::Kind(bytes) => Some(bytes.len()),
}
}