feat(backup): local exclusions — data layer + reconciler #1371

Merged
chris merged 1 commit from feat/exclusions-data into main 2026-10-25 09:42:19 +01:00
Owner
No description provided.
feat(backup): local exclusions data layer — excluded_media table, reconciler rule, engine threading
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 / 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 postgres image (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 / 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 ML worker image (push) Has been skipped
Build and Deploy / Build people 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 5s
Build and Deploy / Android unit tests and debug APK (push) Successful in 5m29s
88b1991f42
Data + engine half of "Nicht in Memories" (design doc 2026-10-25). Local-only,
revertible per-item and per-album exclusions; server and specs untouched.

- Room v4→v5 (MIGRATION_4_5): new excluded_media table (mediaStoreId PK,
  excludedAt, displayName, contentUri) + album_preference.excludedAt
  (nullable; legacy rows stay NULL = excluded without a known date).
- ExcludedMediaRepository contract (verbatim per UI-lane agreement) +
  RoomExcludedMediaRepository; registered in AppContainer and threaded into
  BackupEngine from AndroidSyncController.
- SyncDao: excluded_media CRUD (upsert/delete/ids/all/observe/count) and
  setAlbumIncluded upsert that stamps excludedAt on exclude, NULL on include
  (keeps the AlbumPreferenceRepository.setIncluded signature — AlbumsViewModel
  untouched).
- Reconciler: new defaulted excludedMediaIds param; per-item exclusion joins
  the bucket check in rule 1 (exclusion wins over everything, incl. shadow).
- BackupEngine: optional excludedMediaRepository (null = pre-exclusions
  behavior); reads the id snapshot beside excludedBucketIds and threads both
  into every reconcile pass (initial + post-pre-bind re-reconcile).
- room-ktx added for the DAO Flow observer.

Tests (+26): ReconcilerTest 20→26 (per-item beats fingerprint, wins over
UPLOADED and shadow, re-include → pending, bucket+item combine),
BackupEngineTest 44→46 (id-set threading, revert run re-uploads),
SyncDaoTest 27→30 (excluded_media CRUD, repository contract, album
excludedAt round-trip), MemoriesDatabaseMigrationTest 4→5 (v4→v5 schema +
legacy album row preserved with NULL excludedAt).

:core:test + :app:testDebugUnitTest: 844 tests, 0 failures.
chris merged commit dd4ea1fa9c into main 2026-10-25 09:42:19 +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!1371
No description provided.