mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 23:34:49 +01:00
fix: don't send anything if change is a noop
This commit is contained in:
parent
783a51a831
commit
3e37d4ffe3
1 changed files with 6 additions and 4 deletions
|
@ -108,10 +108,12 @@ impl ControllerWorker<TextChange> for BufferWorker {
|
||||||
branch.insert(&mut oplog, agent_id, change.start as usize, &change.content);
|
branch.insert(&mut oplog, agent_id, change.start as usize, &change.content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if change.is_delete() || change.is_insert() {
|
||||||
tx.send(Operation { data: oplog.encode_from(Default::default(), &last_ver) }).await
|
tx.send(Operation { data: oplog.encode_from(Default::default(), &last_ver) }).await
|
||||||
.unwrap_or_warn("failed to send change!");
|
.unwrap_or_warn("failed to send change!");
|
||||||
self.latest_version.send(oplog.local_version())
|
self.latest_version.send(oplog.local_version())
|
||||||
.unwrap_or_warn("failed to update latest version!");
|
.unwrap_or_warn("failed to update latest version!");
|
||||||
|
}
|
||||||
ack.send(branch.local_version()).unwrap_or_warn("controller didn't wait for ack");
|
ack.send(branch.local_version()).unwrap_or_warn("controller didn't wait for ack");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue