Fix divergence bug in undo/redo
As part of #1405, we changed the way we performed undo and redo to support combining transactions that were not temporally adjacent for IME purposes. We introduced a bug with that release that caused divergence when performing undo: the bug was caused by only changing the visibility of fragments whose insertion id was contained in the undo operation. However, an undo operation also affects deletions which we were mistakenly not considering. Randomized tests caught this but I guess we didn't run enough of them.
This commit is contained in:
@@ -39,7 +39,6 @@ pub fn serialize_operation(operation: &Operation) -> proto::Operation {
|
||||
local_timestamp: undo.id.value,
|
||||
lamport_timestamp: lamport_timestamp.value,
|
||||
version: serialize_version(&undo.version),
|
||||
transaction_version: serialize_version(&undo.transaction_version),
|
||||
counts: undo
|
||||
.counts
|
||||
.iter()
|
||||
@@ -199,7 +198,6 @@ pub fn deserialize_operation(message: proto::Operation) -> Result<Operation> {
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
transaction_version: deserialize_version(undo.transaction_version),
|
||||
},
|
||||
}),
|
||||
proto::operation::Variant::UpdateSelections(message) => {
|
||||
|
||||
Reference in New Issue
Block a user