WebDAV: Fix dead property updates (closes #1611)

This commit is contained in:
mdecimus
2025-06-01 16:33:15 +02:00
parent b3bb2bffb8
commit b3fd99673e
3 changed files with 17 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ impl DeadProperty {
let mut remove = false;
self.0.retain(|item| match item {
DeadPropertyTag::ElementStart(tag) => {
if depth == 0 && !remove && tag == element {
if depth == 0 && !remove && tag.name == element.name {
remove = true;
}
depth += 1;

View File

@@ -92,7 +92,7 @@ pub(crate) enum DavQueryFilter {
pub(crate) trait ETag {
fn etag(&self) -> String;
fn ctag(&self) -> String;
//fn ctag(&self) -> String;
}
pub(crate) trait ExtractETag {
@@ -104,9 +104,9 @@ impl<T> ETag for Archive<T> {
format!("\"{}\"", self.version.hash().unwrap_or_default())
}
fn ctag(&self) -> String {
/*fn ctag(&self) -> String {
format!("\"{}\"", self.version.change_id().unwrap_or_default())
}
}*/
}
impl ExtractETag for BatchBuilder {

View File

@@ -496,13 +496,25 @@ pub async fn test(test: &WebDavTest) {
(
DavProperty::DeadProperty(DeadElementTag::new(
"my-dead-element".to_string(),
Some("xmlns=\"http://example.com/ns/\"".to_string()),
Some("xmlns=\"http://example.com/ns/\" prop=\"abc\"".to_string()),
)),
"this is a dead but exciting element",
),
],
)
.await;
client
.patch_and_check(
path,
[(
DavProperty::DeadProperty(DeadElementTag::new(
"my-dead-element".to_string(),
Some("xmlns=\"http://example.com/ns/\" prop=\"xyz\"".to_string()),
)),
"this is a modified dead but exciting element",
)],
)
.await;
// Test 13: PROPPATCH remove on DAV properties
let mut props = vec![