Skip to content

refactor: HevySyncSource abstraction for sync pipeline - #6

Merged
jdluu merged 1 commit into
mainfrom
refactor/sync-pipeline
Aug 26, 2026
Merged

refactor: HevySyncSource abstraction for sync pipeline#6
jdluu merged 1 commit into
mainfrom
refactor/sync-pipeline

Conversation

@jdluu

@jdluu jdluu commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 5 of the refactor plan.

  • New HevySyncSource interface decouples background sync orchestration from FlexRepository's wide surface - a future second data source plugs in without touching worker/coordinator code
  • BackgroundSyncWorker now injects only what it needs (ISP)
  • DI exposes one FlexRepositoryImpl singleton under both interfaces

Test Plan

  • All 318 pre-existing tests pass unchanged
  • +10 new tests: real doWork() driven via TestListenableWorkerBuilder (success/auth-fail/retry paths), coordinator post-sync hooks, syncAll/syncAllData parity = 328 total
  • ./gradlew testDebugUnitTest lintDebug assembleDebug exit 0, 0 lint errors
  • CI green on this PR

- Add narrow HevySyncSource interface (syncAll) in data/sync
- FlexRepositoryImpl implements it; BackgroundSyncWorker injects the
  interface instead of FlexRepository
- Hilt: same FlexRepositoryImpl singleton exposed as both FlexRepository
  and HevySyncSource; aggregation logic untouched
- Add androidx-work-testing and 10 sync tests (worker retry/failure
  mapping, coordinator post-sync hooks, syncAll parity)
@jdluu
jdluu merged commit b8e3ada into main Aug 26, 2026
3 checks passed
@jdluu
jdluu deleted the refactor/sync-pipeline branch August 26, 2026 04:45
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