feat(desktop): align file stack with live API — listing, folders, upload, download (#207) #211
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!211
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/desk-file-alignment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR-D1a of the #207 align-then-adorn campaign (desktop half of dev-plan task 7.1 contract unification). Server contract PR #210 landed first — this is the client side.
Listing: real routes (root via GET /folders/root/contents; subfolders via GET /folders/{id}/files + /children + GET /folders/{id}), private serde DTOs mapped into the stable FileListResponse envelope — no UI churn. FileItem now carries level + the DEK-wrap triple.
Upload: the dead /files/upload-init/presigned/confirm flow replaced with multipart POST /api/folders/{folderId}/files — container streams as ref-counted Bytes (no 5 GB copy on retry), optional level_id override (F-CLS1), the 201 (with level) mapped to FileItem. The TS pre-encryption pass is deleted — its key args were silently ignored by Rust; Rust is the single crypto authority.
Download: GET /files/{id}/download raw stream (per-request 600s timeout, streamed size cap preserving the #20-sweep discipline); the TS decrypt-after-download pass is deleted; Rust decrypts in-command from the listed row metadata (DownloadMeta).
Folder keys: create_folder sends server field names (wrapped_kek / kem_ciphertext + owner duplicates) and unwraps the {data} envelope; folder-KEK resolution lives in services/folder_keys.rs — decapsulates the DTO string-column wraps, with a documented transitional fallback to derive_folder_kek for keyless folders (dev-plan 2.5 replaces it). Root GUID is resolved server-side (no literal "root" in GUID-constrained routes).
rename_item now hits PATCH /files/{id} or PATCH /folders/{id} with {name} — the old PUT /files/{id} call silently renamed nothing.
Tests: 7 Rust serde contract tests reusing #210's pinned JSON; tauri + fileStore vitest suites aligned to the new invoke shapes; cargo 68 green, vitest 1306 green, tsc clean.
Review: dual-pass done. Pass 2 found the timeout regression (fixed: per-request override), the streaming-cap gap (fixed), and rename hitting UpdateFile (fixed). Tracked follow-ups recorded on #207: move_item + storage-info dead routes, get_preview dead call (7.8).
Known accepted gaps (documented on #207): SQLite cache untouched (dead in live flow — user decision); sharing flow = next PR (D1b); E2EE chunked rows not downloadable yet (no DEK triple).
Related: #207, #158, #210.
319c6386b8ff3912f838ff3912f83867d500af0d