fix(drive): fix drive_id on copy to other drive

- fix alsot drive_id exposition
This commit is contained in:
Edouard Vanbelle
2026-06-29 21:55:47 +02:00
parent e81b297f68
commit 583af517c2
15 changed files with 593 additions and 27 deletions
+5
View File
@@ -125,6 +125,11 @@ pub struct FavoriteResourceRow {
pub resource_created_at: DateTime<Utc>,
pub modified_at: DateTime<Utc>,
pub owner_id: Uuid,
/// Drive that owns this row. Surfaced on the favorites listing
/// so a UI can tell when a favorited item lives in a different
/// drive than the user's home (post-D6 cross-drive moves +
/// copies make this reachable).
pub drive_id: Uuid,
/// Raw BLAKE3 content hash. `Some(_)` for file rows, `None` for
/// folder rows. Routes into `FileDto::content_hash` and feeds
/// `File::compute_etag` to populate `FileDto::etag`.
+6
View File
@@ -206,6 +206,12 @@ pub struct FolderResourceRow {
pub created_at: DateTime<Utc>,
pub modified_at: DateTime<Utc>,
pub owner_id: Uuid,
/// Drive that owns this row. Same column as
/// `storage.folders.drive_id` / `storage.files.drive_id`. Surfaced
/// on the listing so a UI can tell when a child lives in a
/// different drive than its parent (post-D6 cross-drive moves +
/// copies make this reachable).
pub drive_id: Uuid,
/// Raw BLAKE3 content hash. `Some(_)` for file rows, `None` for
/// folder rows. Populates `FileDto::content_hash` + `FileDto::etag`
/// on the REST `/api/folders/{id}/resources` listing so API
+5
View File
@@ -105,6 +105,11 @@ pub struct RecentResourceRow {
pub resource_created_at: DateTime<Utc>,
pub modified_at: DateTime<Utc>,
pub owner_id: Uuid,
/// Drive that owns this row. Surfaced on the recent listing
/// so a UI can tell when a recently-accessed item lives in a
/// different drive than the user's home (post-D6 cross-drive
/// moves + copies make this reachable).
pub drive_id: Uuid,
/// Raw BLAKE3 content hash. `Some(_)` for file rows, `None` for
/// folder rows. Feeds `File::compute_etag` so this listing's
/// `etag` matches GET/HEAD/PROPFIND for the same file.
+4
View File
@@ -155,6 +155,10 @@ pub struct SearchFolderResultDto {
pub path: String,
/// Parent folder ID
pub parent_id: Option<String>,
/// Drive that owns this folder. Same column as `storage.folders.drive_id`,
/// carried through so downstream callers (e.g. the NC search REPORT
/// handler) can populate `FolderDto::drive_id` without a fallback sentinel.
pub drive_id: uuid::Uuid,
/// Creation timestamp
pub created_at: u64,
/// Last modification timestamp
@@ -241,6 +241,7 @@ impl SearchService {
name: folder.name.clone(),
path: folder.path.clone(),
parent_id: folder.parent_id.clone(),
drive_id: folder.drive_id,
created_at: folder.created_at,
modified_at: folder.modified_at,
is_root: folder.is_root,