mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-06 12:25:03 +00:00
fix: one tricky case
This commit is contained in:
parent
819d1f86b9
commit
1a80cb7572
2 changed files with 17 additions and 4 deletions
|
@ -536,10 +536,6 @@ impl AppDag {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if deps == &self.trimmed_frontiers {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
deps.iter().any(|x| self.trimmed_vv.includes_id(*x))
|
deps.iter().any(|x| self.trimmed_vv.includes_id(*x))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1178,4 +1178,21 @@ fn test_map_checkout_on_trimmed_doc() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
new_doc.checkout_to_latest();
|
||||||
|
assert_eq!(
|
||||||
|
new_doc.get_deep_value(),
|
||||||
|
loro_value!({
|
||||||
|
"map": {
|
||||||
|
"0": 0,
|
||||||
|
"1": 1,
|
||||||
|
"2": 4,
|
||||||
|
"3": 3,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
let err = new_doc
|
||||||
|
.checkout(&ID::new(doc.peer_id(), 0).into())
|
||||||
|
.unwrap_err();
|
||||||
|
assert_eq!(err, LoroError::SwitchToTrimmedVersion);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue