Skip to content

Implement incremental delta sync engine (Milestone M3, v6.0.12) - #13

Merged
66Ton99 merged 2 commits into
mainfrom
feat/android-delta-sync-m3
Nov 4, 2026
Merged

66Ton99 merged 2 commits into
mainfrom
feat/android-delta-sync-m3

Conversation

@66Ton99

@66Ton99 66Ton99 commented Nov 4, 2026

Copy link
Copy Markdown

Summary

This PR delivers Milestone M3 of the Passly synchronization protocol (sync/1) for passly_android, alongside release hygiene bumping to v6.0.12 (versionCode 69).

Key Deliverables:

  1. Incremental Delta Synchronization Engine (core/sync):

    • DeltaSyncStrategy: Consumes paginated change journal from /sync/changes.json?since={localSeq} and parses additions, modifications, and deletions.
    • ChangesApplier: Atomically persists batch operations across resources, secrets, and permissions tables in a single Room transaction while advancing localSeq.
    • BootstrapStrategy: Transparent recovery handler when receiving HTTP 410 Gone (cursor older than server retention threshold) or for initial onboarding via /sync/bootstrap.json.
    • ManifestReconciler: Periodic sanity verification against /sync/manifest.json to identify and prune orphaned or revoked entries.
    • SyncEngine: Master coordinator orchestrating delta sync, 410 Gone fallback, manifest reconciliation, backoff, and telemetry.
  2. Room Database Schema 31 (core/database):

    • Created SyncState entity and SyncStateDao to durably persist monotonic cursor, server epoch, lastSyncTimestamp, and lastReconcileTimestamp.
    • Implemented automated migration Migration30to31.kt with verified schema snapshot.
  3. Background WorkManager Scheduling (core/sync/work):

    • SyncWorker: Coroutine worker with NetworkType.CONNECTED constraint and exponential backoff.
    • SyncScheduler: Enqueues periodic background runs (15 min intervals) and dispatches immediate manual sync triggers.
  4. UI Refresh Integration & Data Absence Policy (core/fulldatarefresh):

    • Wired FullDataRefreshExecutor into SyncEngine.
    • Enforced Policy: Full initial data refresh / bootstrap is strictly executed only when local replica data is completely absent. Whenever local replica data exists, lightweight incremental delta sync is executed, eliminating UI blocking spinners on HomeScreen and OtpScreen.
  5. Testing & Verification:

    • 31 unit and integration E2E tests passing in :sync.
    • Unit tests covering fast delta vs. full initial refresh policy in :fulldatarefresh.

…dentialProviderService leak

- Added 26 functional E2E tests covering online data refresh, offline vault replica, authentication lifecycle, sync resilience, and resource management
- Fixed CredentialProviderService$1 framework Binder stub memory leak reported by LeakCanary via reflection cleanup on onDestroy
- Added LeakCanary/Shark ignoredInstanceField reference matchers for AOSP Android 14+ CredentialProviderService Binder stubs
- Bumped app version to 6.0.10 (versionCode 67)
- Implement DeltaSyncStrategy, ChangesApplier, BootstrapStrategy, and ManifestReconciler
- Orchestrate synchronization via SyncEngine with transparent 410 Gone fallback
- Add Room database Schema 31 with persistent SyncState table and migration
- Wire WorkManager background scheduling via SyncWorker and SyncScheduler
- Integrate FullDataRefreshExecutor with SyncEngine to enforce fast delta sync when local replica exists
- Ensure full sync/bootstrap only occurs when local replica data is absent
- Add comprehensive unit and integration E2E test suites
- Bump version to 6.0.12 (versionCode 69)
@66Ton99
66Ton99 merged commit 613cc21 into main Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant