diff options
Diffstat (limited to 'src/swarm/sync.rs')
| -rw-r--r-- | src/swarm/sync.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index e3f6055..3a3d92c 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -300,11 +300,15 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> { // With changes, the signatures of those it carries: they go where // changes go, along the trees, so a peer that got these changes // elsewhere got the signatures with them; and changes sent again go - // vouched for as the first time. A delta, of any writer's changes, - // each writer's latest. A message carrying no changes takes none. + // vouched for as the first time. A delta, of each writer with changes + // in it, its latest. A message carrying no changes takes none. let signatures = match &body { - Some(transport::SyncBody::Delta(_)) => replica.signatures.latest_each(), - Some(_) => replica.signatures.for_changes(peer_state.sync.carried()), + Some(transport::SyncBody::Delta(spec)) => { + replica.signatures.for_delta(&replica.doc, &spec.from) + } + Some(_) => replica + .signatures + .for_changes(&replica.doc, peer_state.sync.carried()), None => Vec::new(), }; let signatures = crate::document::signatures::pack(&signatures); |
