chore: try to fix inifinite sync (#756)
This commit is contained in:
parent
ed2a3fd1ee
commit
c8ee6b43ee
|
|
@ -222,7 +222,7 @@ where
|
|||
},
|
||||
Some(sv) => {
|
||||
trace!(
|
||||
"🔥{} start init sync, reason:{}",
|
||||
"🔥{} start init sync with state vector, reason:{}",
|
||||
&sync_object.object_id,
|
||||
reason
|
||||
);
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ pub enum RTProtocolError {
|
|||
|
||||
#[error("Missing Updates")]
|
||||
MissUpdates {
|
||||
/// - `state_vector_v1`: Contains the last known state vector from the client. If `None`,
|
||||
/// - `state_vector_v1`: Contains the last known state vector from the Collab. If `None`,
|
||||
/// this indicates that the receiver needs to perform a full initialization synchronization starting from sync step 0.
|
||||
///
|
||||
/// The receiver uses this information to determine how to recover from the error,
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ impl CollabSyncProtocol for ClientSyncProtocol {
|
|||
update.missing.is_empty()
|
||||
);
|
||||
}
|
||||
// let state_vector_v1 = update.missing.encode_v1();
|
||||
let state_vector_v1 = txn.state_vector().encode_v1();
|
||||
Err(RTProtocolError::MissUpdates {
|
||||
state_vector_v1: None,
|
||||
state_vector_v1: Some(state_vector_v1),
|
||||
reason: "client miss updates".to_string(),
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -67,8 +67,9 @@ impl CollabSyncProtocol for ServerSyncProtocol {
|
|||
// let state_vector_v1 = update.missing.encode_v1();
|
||||
// for the moment, we don't need to send missing updates to the client. passing None
|
||||
// instead, which will trigger a sync step 0 on client
|
||||
let state_vector_v1 = txn.state_vector().encode_v1();
|
||||
Err(RTProtocolError::MissUpdates {
|
||||
state_vector_v1: None,
|
||||
state_vector_v1: Some(state_vector_v1),
|
||||
reason: "server miss updates".to_string(),
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue