feat: 暂存工作区载荷并捕获外部 Sync 变更

This commit is contained in:
2026-09-08 16:15:09 +08:00
parent 91ef49442d
commit f08a338ece
11 changed files with 589 additions and 35 deletions
+4 -5
View File
@@ -47,6 +47,9 @@ impl RemoteRevision {
{
return Err(HostError::new("SYNC_RESPONSE_INVALID"));
}
if !crate::sync_discovery::allowed(&self.path) {
return Err(HostError::new("SYNC_CLASS_UNSUPPORTED"));
}
Ok(())
}
}
@@ -61,11 +64,7 @@ impl Workspace {
if self.sync_binding()?.is_some() {
return Err(HostError::new("SYNC_ALREADY_BOUND"));
}
if self
.scan()?
.iter()
.any(|entry| !entry.is_folder && !entry.deleted)
{
if !self.sync_paths()?.is_empty() {
return Err(HostError::new("SYNC_RECONCILIATION_REQUIRED"));
}
let id = Uuid::new_v4().to_string();