Observe selection set lamport timestamps when deserializing buffer

This commit is contained in:
Antonio Scandurra 2022-03-04 09:34:30 +01:00
parent bcd5c28833
commit 7c420050c7

View file

@ -426,16 +426,18 @@ impl Buffer {
this.apply_ops(ops, cx)?;
for selection_set in message.selections {
let lamport_timestamp = clock::Lamport {
replica_id: selection_set.replica_id as ReplicaId,
value: selection_set.lamport_timestamp,
};
this.remote_selections.insert(
selection_set.replica_id as ReplicaId,
SelectionSet {
selections: proto::deserialize_selections(selection_set.selections),
lamport_timestamp: clock::Lamport {
replica_id: selection_set.replica_id as ReplicaId,
value: selection_set.lamport_timestamp,
},
lamport_timestamp,
},
);
this.text.lamport_clock.observe(lamport_timestamp);
}
let snapshot = this.snapshot();
let entries = proto::deserialize_diagnostics(message.diagnostics);