fix(backup): deduped uploads counted as skipped, not uploaded #1385
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/upload-dedup-count"
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?
0.10.10 report: uploading 3×6 byte-identical photos showed „18 hochgeladen". The server already dedupes at commit (S4-C1 `skipExistingOwnerDuplicate` → `deduplication_state = skipped_existing_owner_media`, storage reuse `reused_stored_object`), but the commit response carried no per-file verdict, so the client counted every file entering the session as uploaded.
Server (additive only)
Client
Tests — server: commit response carries per-file verdicts (reused + skipped cases; aggregate reads omit the field); client: engine 1 new + 2 deduped → uploadedCount=1, dedupedCount=2, all 3 UPLOADED; reused_stored_object counts as uploaded; absent-verdict degradation; response-parse contract; worker snapshot key contract + pre-fix degradation; stats formatter incl. de/en/da.
Verification
KNOWN_ISSUES: ISSUE-206 (med/resolved/area:api). Rebased on origin/main
eb63219f. Do NOT merge — orchestrator reviews.0.10.10 counted server-side dedupes as uploaded (3x6 identical photos showed '18 hochgeladen'): the commit response carried no per-file dedup verdict, so the client counted every file entering the session as uploaded even though UploadCommitService had set deduplication_state and skipped creating the item. Server (additive): the commit response now carries files:[{fileId,deduplicationState}] for exactly the files the call committed (UploadSessionFileDedup, NON_NULL - absent on every aggregate read so older clients are unaffected); OpenAPI UploadSession amended. Client: BackupEngine parses the verdicts and adds BackupRunResult.dedupedCount. Ruling: skipped_existing_owner_media = deduped (owner already had the media); reused_stored_object / new_stored_object = uploaded (new media item, bytes possibly shared). Deduped files STAY marked UPLOADED locally - only the run statistics split them out of uploadedCount; skippedCount keeps its reconciler meaning. BackupWorker/BackupWorkSnapshot carry dedupedCount as their own bucket and the stats row appends 'Duplikate übersprungen N' / 'duplicates skipped N' / 'dubletter sprunget over N' (de/en/da). KNOWN_ISSUES: ISSUE-206 (med/resolved/area:api).