From e50a5ced65a1f03ebdbe5b0d3b09a57b11b7edbe Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 01:40:44 +0100 Subject: refuse misplaced authors --- src/state/host.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/state/host.rs') diff --git a/src/state/host.rs b/src/state/host.rs index 5751998..b4a785b 100644 --- a/src/state/host.rs +++ b/src/state/host.rs @@ -374,6 +374,11 @@ impl Host for AppState { ) -> impl Future> + Send { let state = self.clone(); async move { + // Downloaded: looked at before Automerge applies it (`misplaced_author`). + if let Some(misplaced) = crate::document::changes::misplaced_author(change.raw_bytes()) + { + return Err(misplaced.to_string()); + } tokio::task::spawn_blocking(move || { let result = { let mut replica = state.doc.blocking_write(); -- cgit v1.3.1