aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 03:54:45 +0100
committertv <tv@krebsco.de>2026-10-31 03:54:45 +0100
commitd59cec8e6fd56bfbe91e251ec35e3e3e1f3f95dd (patch)
treeb5b2f79179b8b70c5fd0caa6a7c7b76bf853df75 /src/swarm
parent0bb3924836205a0364aaf0959c7cf387db004794 (diff)
move ChangeSet from swarm to document
Diffstat (limited to 'src/swarm')
-rw-r--r--src/swarm/sync.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index df4bb2d..05c0c34 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -10,6 +10,7 @@ use tokio::sync::mpsc;
use tokio::time::Instant;
use tracing::{debug, info, trace, warn};
+use crate::document::store::ChangeSet;
use crate::locks::MutexExt;
use crate::state::{AppState, Liveness, PeerState, Standing};
use crate::swarm::peer::{peer_swarm, send_hello_once};
@@ -25,12 +26,6 @@ pub(crate) enum SyncEvent {
PeerNeedsSync(String),
}
-/// Store paths touched by one batch of document changes.
-#[derive(Debug)]
-pub(crate) struct ChangeSet {
- pub(crate) paths: Vec<Vec<String>>,
-}
-
async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> {
if state.remake.fetching_snapshot() {
// Rejoining: the snapshot comes as a download, not in a sync message. Sync
@@ -645,10 +640,6 @@ fn patch_store_path(patch: &automerge::Patch) -> Vec<String> {
path
}
-pub(crate) fn paths_related(a: &[String], b: &[String]) -> bool {
- a.starts_with(b) || b.starts_with(a)
-}
-
pub(crate) async fn run_change_publisher(state: AppState) {
let mut changed = state.change_tx.subscribe();
let mut last_heads = state.write_doc(|doc| doc.get_heads()).await;