feat(upload): plannedFileCount from backup engine; cap 1M #1535

Merged
chris merged 1 commit from feat/upload-planned-count into main 2026-11-15 23:04:55 +01:00
Owner

Summary

Android backup runs created upload sessions without plannedFileCount, so the activity feed's receive progress fell back to a growing received-count denominator — the X/X-grows-on-both-sides bug. Now the backup engine threads reconciled.pending.size through session creation (clamped to the new server cap), giving every run a stable at-start denominator.

Changes

  • BackupEngine: pending count → openOrRecoverBatch → createBatch → UploadSessionClient.createSession(plannedFileCount); clamp MAX_PLANNED_FILE_COUNT = 1_000_000
  • UploadSessionService: validatePlannedFileCount cap 100_000 → 1_000_000 (real runs exceed 100k; ~300k observed)
  • Manual picker path untouched (already correct)
  • Empty pending lists still never create a session (early exit pinned by test); session reuse keeps the plan it was created with (documented)

Tests

  • Android core: BUILD SUCCESSFUL, 216 tests / 0 failures (BackupEngineTest 57, incl. 3 new/extended)
  • Backend: BUILD SUCCESSFUL, 52 tests / 0 failures (UploadActivityTest 31, incl. boundary 1_000_000 accepts, 1_000_001 rejects)
## Summary Android backup runs created upload sessions without `plannedFileCount`, so the activity feed's receive progress fell back to a growing received-count denominator — the X/X-grows-on-both-sides bug. Now the backup engine threads `reconciled.pending.size` through session creation (clamped to the new server cap), giving every run a stable at-start denominator. ## Changes - `BackupEngine`: pending count → `openOrRecoverBatch` → `createBatch` → `UploadSessionClient.createSession(plannedFileCount)`; clamp `MAX_PLANNED_FILE_COUNT = 1_000_000` - `UploadSessionService`: `validatePlannedFileCount` cap 100_000 → 1_000_000 (real runs exceed 100k; ~300k observed) - Manual picker path untouched (already correct) - Empty pending lists still never create a session (early exit pinned by test); session reuse keeps the plan it was created with (documented) ## Tests - Android core: BUILD SUCCESSFUL, 216 tests / 0 failures (BackupEngineTest 57, incl. 3 new/extended) - Backend: BUILD SUCCESSFUL, 52 tests / 0 failures (UploadActivityTest 31, incl. boundary 1_000_000 accepts, 1_000_001 rejects)
feat(upload): send plannedFileCount from backup engine; raise backend cap to 1M
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Deploy review instance (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 10m41s
Build and Deploy / Android unit tests and debug APK (push) Successful in 12m41s
afaabcba26
Backup runs created upload sessions without a planned file count, so the
activity feed fell back to a growing received-count denominator (X/X grew
on both sides). Thread reconciled.pending.size through openOrRecoverBatch
-> createBatch -> UploadSessionClient.createSession, clamped to the new
server cap of 1,000,000. Manual picker uploads already sent the count.

Empty pending lists still never create a session (early exit, pinned by
test). Session reuse keeps the plan it was created with (documented).
chris merged commit af128c63b6 into main 2026-11-15 23:04:55 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1535
No description provided.