aboutsummaryrefslogtreecommitdiffstats
path: root/src/state
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-07 01:40:44 +0100
committertv <tv@krebsco.de>2026-11-07 01:40:44 +0100
commite50a5ced65a1f03ebdbe5b0d3b09a57b11b7edbe (patch)
tree88493cdc06a841dab564cee46a989945a89530fa /src/state
parent4eb8eda89db812c3aa40f0226853aa9a20809a92 (diff)
refuse misplaced authors
Diffstat (limited to 'src/state')
-rw-r--r--src/state/host.rs5
1 files changed, 5 insertions, 0 deletions
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<Output = Result<(), String>> + 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();