mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-11 14:53:12 +00:00
fix: encoding merge err
This commit is contained in:
parent
2e1d5080a5
commit
3bb2d3490d
1 changed files with 14 additions and 2 deletions
|
@ -4,6 +4,7 @@ use fxhash::FxHashMap;
|
|||
use rle::{HasLength, RleVec, RleVecWithIndex};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_columnar::{columnar, compress, decompress, from_bytes, to_vec, CompressConfig};
|
||||
use smallvec::smallvec;
|
||||
|
||||
use crate::{
|
||||
change::{Change, ChangeMergeCfg, Lamport, Timestamp},
|
||||
|
@ -11,6 +12,7 @@ use crate::{
|
|||
container::{
|
||||
list::list_op::{DeleteSpan, ListOp},
|
||||
map::MapSet,
|
||||
registry::ContainerIdx,
|
||||
text::text_content::ListSlice,
|
||||
Container, ContainerID,
|
||||
},
|
||||
|
@ -22,6 +24,8 @@ use crate::{
|
|||
ContainerType, InternalString, LogStore, LoroValue, VersionVector,
|
||||
};
|
||||
|
||||
use super::ImportContext;
|
||||
|
||||
type ClientIdx = u32;
|
||||
type Clients = Vec<ClientID>;
|
||||
type Containers = Vec<ContainerID>;
|
||||
|
@ -337,9 +341,17 @@ fn decode_changes(
|
|||
// SAFETY: ignore lifetime issues here, because it's safe for us to store the mutex guard here
|
||||
.map(|(k, v)| (k, unsafe { std::mem::transmute(v.lock().unwrap()) }))
|
||||
.collect();
|
||||
store.apply(&frontiers, &vv, container_map);
|
||||
let mut context = ImportContext {
|
||||
old_frontiers: smallvec![],
|
||||
new_frontiers: frontiers.get_frontiers(),
|
||||
old_vv: Default::default(),
|
||||
spans: vv.diff(&Default::default()).left,
|
||||
new_vv: vv,
|
||||
diff: Default::default(),
|
||||
};
|
||||
store.apply(container_map, &mut context);
|
||||
|
||||
store.vv = vv;
|
||||
store.vv = context.new_vv;
|
||||
store.frontiers = frontiers.get_frontiers();
|
||||
drop(store);
|
||||
// FIXME: set all
|
||||
|
|
Loading…
Reference in a new issue