aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/relay.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-29 04:00:43 +0000
committertv <tv@krebsco.de>2026-11-29 04:00:43 +0000
commit2ae7562083f5f96490f90e9398762cf6a024d51e (patch)
tree5e23c6bda5682e39413fe557348023cc4204d487 /src/swarm/relay.rs
parentf497cf6ef14de8204bc1edec078116593d791b97 (diff)
document: a unit's name, which the swarm passes on by
document::UnitId: the name of a unit of a document as its kind has it, an Automerge change's hash. What the swarm announces, forwards along trees, tells a peer it refused and drops is named so (the dissemination, relay, refusals, AppState::drop_taken), and the session is told so what a peer gets from another; a change's hash it is where the document is asked, and on the wire.
Diffstat (limited to 'src/swarm/relay.rs')
-rw-r--r--src/swarm/relay.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/swarm/relay.rs b/src/swarm/relay.rs
index 54749b0..560a41e 100644
--- a/src/swarm/relay.rs
+++ b/src/swarm/relay.rs
@@ -153,7 +153,7 @@ pub(crate) struct Pending {
pub(crate) async fn announce(
state: &AppState,
from: &str,
- writers: &[(u64, Vec<crate::document::ChangeHash>)],
+ writers: &[(u64, Vec<crate::document::UnitId>)],
unauthored: bool,
) {
if !state.initial_sync_done.load(Ordering::Acquire) {
@@ -343,6 +343,8 @@ pub(crate) async fn pull_after_grace(state: &AppState, peer: &str, remote: &tran
crate::document::changes::missing(&replica.doc, remote.heads.listed())
};
if !missing.is_empty() {
+ let missing: Vec<crate::document::UnitId> =
+ missing.into_iter().map(Into::into).collect();
state.dissemination().announced(peer, &missing);
let grace = state
.lock_rtt()