aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 04:32:55 +0100
committertv <tv@krebsco.de>2026-11-06 04:32:55 +0100
commit0ea7f3aea1b007339c76427604cb551027379f81 (patch)
treea28f82cbbcc47d9528e4defcc97d9f2e86ff2960 /src/document
parent8a37ace76af52a3497213d5aa5531c85726e1ef6 (diff)
sent hashes measured
Diffstat (limited to 'src/document')
-rw-r--r--src/document/sync.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/document/sync.rs b/src/document/sync.rs
index 179df78..7123138 100644
--- a/src/document/sync.rs
+++ b/src/document/sync.rs
@@ -615,6 +615,14 @@ impl SyncSession {
hashes.len()
}
+ /// How many changes count as sent to the peer (`sent_hashes`): kept until the peer's
+ /// message says it has them (Automerge), or forgotten when a send fails or its
+ /// answer is overdue.
+ #[cfg(test)]
+ pub(crate) fn sent_hashes_len(&self) -> usize {
+ self.state.sent_hashes.len()
+ }
+
/// Of the changes in `doc` beyond `from`, how many the peer has too, as far as we
/// know (its heads' history, and what went either way since, `sent_hashes`). A delta
/// it offers from `from` brings those again: offered before it heard what we have