From 1ec56e17435aa9ea03e2090bb0230fc157c0eb8c Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 24 Jul 2025 17:02:38 +0000 Subject: [PATCH] fix(tests): resolve issues with compilation in tests --- src/db/webdav.rs | 13 +++++++++++++ tests/integration_smart_sync_deep_scan.rs | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/db/webdav.rs b/src/db/webdav.rs index f2317e2..24297ef 100644 --- a/src/db/webdav.rs +++ b/src/db/webdav.rs @@ -352,6 +352,19 @@ impl Database { Ok(result.rows_affected() as i64) } + /// Delete a specific WebDAV directory by path + pub async fn delete_webdav_directory(&self, user_id: Uuid, directory_path: &str) -> Result { + let result = sqlx::query( + r#"DELETE FROM webdav_directories WHERE user_id = $1 AND directory_path = $2"# + ) + .bind(user_id) + .bind(directory_path) + .execute(&self.pool) + .await?; + + Ok(result.rows_affected() > 0) + } + /// Find directories with incomplete scans that need recovery pub async fn get_incomplete_webdav_scans(&self, user_id: Uuid) -> Result> { let rows = sqlx::query( diff --git a/tests/integration_smart_sync_deep_scan.rs b/tests/integration_smart_sync_deep_scan.rs index e67b6a2..b48ee17 100644 --- a/tests/integration_smart_sync_deep_scan.rs +++ b/tests/integration_smart_sync_deep_scan.rs @@ -287,7 +287,7 @@ async fn test_deep_scan_performance_with_many_directories() { user_id: user.id, directory_path: format!("/Documents/Old{:03}", i), directory_etag: format!("old-etag-{:03}", i), - file_count: i as i32 % 20 + 1, // 1-20 files + file_count: i as i64 % 20 + 1, // 1-20 files total_size_bytes: (i as i64 + 1) * 4000, // Varying sizes }; @@ -322,7 +322,7 @@ async fn test_deep_scan_performance_with_many_directories() { user_id: user.id, directory_path: format!("/Documents/New{:03}", i), directory_etag: format!("new-etag-{:03}", i), - file_count: i as i32 % 15 + 1, // 1-15 files + file_count: i as i64 % 15 + 1, // 1-15 files total_size_bytes: (i as i64 + 1) * 5000, // Different sizing };