feat(drive): complete updated_by created_by

This commit is contained in:
Edouard Vanbelle
2026-06-19 10:51:13 +02:00
parent 06116dc6e7
commit e7f4826778
34 changed files with 987 additions and 230 deletions
@@ -417,6 +417,7 @@ impl ChunkedUploadHandler {
parts.folder_id.clone(),
ingested.content_type.clone(),
ingested.stored(),
auth_user.id,
)
.await
{
@@ -273,6 +273,9 @@ pub async fn list_favorites_resources(
icon_class: std::sync::Arc::from("fas fa-folder"),
icon_special_class: std::sync::Arc::from("folder-icon"),
category: std::sync::Arc::from("Folder"),
// §14 provenance not selected by the favorites query.
created_by: None,
updated_by: None,
};
FavoritesResourceItemDto {
resource_type: ResourceTypeDto::Folder,
@@ -316,6 +319,9 @@ pub async fn list_favorites_resources(
sort_date: None,
content_hash,
etag,
// §14 provenance not selected by the favorites query.
created_by: None,
updated_by: None,
};
FavoritesResourceItemDto {
resource_type: ResourceTypeDto::File,
@@ -284,6 +284,7 @@ impl FileHandler {
folder_id,
ingested.content_type.clone(),
ingested.stored(),
auth_user.id,
)
.await
{
@@ -711,6 +711,9 @@ pub async fn list_folder_resources(
icon_class: Arc::from("fas fa-folder"),
icon_special_class: Arc::from("folder-icon"),
category: Arc::from("Folder"),
// §14 provenance not selected by the resources query.
created_by: None,
updated_by: None,
};
FolderResourceItemDto {
resource_type: ResourceTypeDto::Folder,
@@ -753,6 +756,9 @@ pub async fn list_folder_resources(
sort_date: None,
content_hash,
etag,
// §14 provenance not selected by the resources query.
created_by: None,
updated_by: None,
};
FolderResourceItemDto {
resource_type: ResourceTypeDto::File,
@@ -303,6 +303,9 @@ pub async fn list_recent_resources(
icon_class: std::sync::Arc::from("fas fa-folder"),
icon_special_class: std::sync::Arc::from("folder-icon"),
category: std::sync::Arc::from("Folder"),
// §14 provenance not selected by the recents query.
created_by: None,
updated_by: None,
};
RecentResourceItemDto {
resource_type: ResourceTypeDto::Folder,
@@ -344,6 +347,9 @@ pub async fn list_recent_resources(
sort_date: None,
content_hash,
etag,
// §14 provenance not selected by the recents query.
created_by: None,
updated_by: None,
};
RecentResourceItemDto {
resource_type: ResourceTypeDto::File,
+11 -1
View File
@@ -438,6 +438,9 @@ async fn handle_propfind(
icon_class: Arc::from("fas fa-folder"),
icon_special_class: Arc::from("folder-icon"),
category: Arc::from("Folder"),
// §14 provenance not applicable to the synthetic root.
created_by: None,
updated_by: None,
};
return build_streaming_propfind_response(
@@ -1197,7 +1200,14 @@ async fn handle_put(
let content_type = ingested.content_type.clone();
let drive_id = resolve_drive_id_for_native_webdav(&state, user.id).await?;
let result = file_upload_service
.update_file_streaming(&path, drive_id, ingested.stored(), &content_type, None)
.update_file_streaming(
&path,
drive_id,
ingested.stored(),
&content_type,
None,
user.id,
)
.await;
match result {
+8 -1
View File
@@ -258,7 +258,14 @@ async fn put_file(
.app_state
.applications
.file_upload_service
.update_file_streaming(&file.path, drive_id, ingested.stored(), &content_type, None)
.update_file_streaming(
&file.path,
drive_id,
ingested.stored(),
&content_type,
None,
claims_sub_uuid,
)
.await;
match result {
@@ -344,6 +344,9 @@ fn file_dto_from_search(fr: &crate::application::dtos::search_dto::SearchFileRes
sort_date: None,
content_hash: fr.blob_hash.clone(),
etag,
// §14 provenance not selected by the search result DTO.
created_by: None,
updated_by: None,
}
}
@@ -368,6 +371,9 @@ fn folder_dto_from_search(
icon_class: Arc::from("fas fa-folder"),
icon_special_class: Arc::from("folder-icon"),
category: Arc::from("Folder"),
// §14 provenance not selected by search results.
created_by: None,
updated_by: None,
}
}
@@ -298,6 +298,7 @@ async fn handle_assemble(
ingested.stored(),
&content_type,
oc_mtime,
user.id,
)
.await
.map_err(|e| AppError::internal_error(format!("Failed to update file: {}", e)))?;
@@ -334,6 +335,7 @@ async fn handle_assemble(
Some(parent_folder.id),
content_type.to_string(),
ingested.stored(),
user.id,
)
.await
.map_err(|e| AppError::internal_error(format!("Failed to create file: {}", e)))?;
@@ -754,6 +754,7 @@ async fn handle_put(
ingested.stored(),
&content_type,
oc_mtime,
session.user.id,
)
.await
.map_err(|e| AppError::internal_error(format!("Failed to store file: {}", e)))?;
@@ -1667,6 +1668,9 @@ mod tests {
icon_special_class: std::sync::Arc::from("folder-icon"),
category: std::sync::Arc::from("Folder"),
etag: String::new(),
// §14 provenance not relevant to path-mapper tests.
created_by: None,
updated_by: None,
}
}