fix(desktop): send on_conflict=overwrite on move so same-name replace works (#155)

Cut/paste with "replace target" emits a rename whose destination name
still exists remotely; the server default fail-fast conflict produced
"cloud operation failed". The OS already resolved local naming before
the event, so the stale remote entity is overwritten.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
pull/3587/head
Tomas Dvorak 2 weeks ago
parent 533fcad647
commit f91e553336

@ -287,6 +287,12 @@ pub struct MoveFileService {
pub dst: String, pub dst: String,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub copy: Option<bool>, pub copy: Option<bool>,
/// Behaviour when a destination child with the same name exists:
/// "skip" drops the colliding source, "overwrite" deletes the
/// destination object first. Absent keeps the server default
/// (fail with a conflict error).
#[serde(skip_serializing_if = "Option::is_none")]
pub on_conflict: Option<String>,
} }
/// Metadata patch /// Metadata patch

@ -585,6 +585,11 @@ impl Mount {
)? )?
.to_string(), .to_string(),
copy: None, copy: None,
// The OS already resolved local naming before emitting the
// rename (Explorer prompts replace/skip; skip produces no
// event), so a remote name collision at the destination is a
// stale remote entity and must be overwritten.
on_conflict: Some("overwrite".to_string()),
}) })
.await .await
{ {

Loading…
Cancel
Save