Skip to content

[MS-1044] CoSync Background Syncing - Phase 1 (MVP)#1247

Merged
BurningAXE merged 8 commits into
mainfrom
MS-1044-co-down-sync
Aug 19, 2025
Merged

[MS-1044] CoSync Background Syncing - Phase 1 (MVP)#1247
BurningAXE merged 8 commits into
mainfrom
MS-1044-co-down-sync

Conversation

@BurningAXE
Copy link
Copy Markdown
Contributor

@BurningAXE BurningAXE commented Jul 3, 2025

JIRA ticket
Will be released in: 2025.3.0

Notable changes

This is the first phase of CoDownSync - sort of an MVP where background syncing from CommCare works but in a "dumb" way where all records are fetched every time. Optimizations to this process will happen in Phase 2.

See CoPilot's (surprisingly good) description of the PR changes below.

Testing guidance

  • Setup a project with CommCare downsync
  • Install CommCare on the device
  • Login with a users that has access to cases with CoSync data in subjectActions (ping me if you need help with this)
  • Wait and verify that sync happens periodically

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

@cla-bot cla-bot Bot added the ... label Jul 3, 2025
@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch from dd127ea to 6900f70 Compare July 8, 2025 13:28
@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch 10 times, most recently from e3522eb to 25c9d22 Compare July 29, 2025 16:05
@BurningAXE BurningAXE requested a review from Copilot July 29, 2025 16:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the first phase (MVP) of CoSync background syncing by adding support for CommCare as an alternative sync source alongside the existing Simprints backend integration. The key changes include refactoring the sync infrastructure to support multiple sync providers, implementing CommCare content provider integration, and introducing proper permission handling for CommCare access.

Key changes:

  • Refactored sync architecture to support multiple providers (Simprints and CommCare)
  • Implemented CommCare content provider integration for syncing data
  • Added permission handling for CommCare access in setup flow

Reviewed Changes

Copilot reviewed 93 out of 93 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
infra/sync/src/main/java/com/simprints/infra/sync/config/usecase/ResetLocalRecordsIfConfigChangedUseCase.kt Enhanced to detect sync source changes between Simprints and CommCare
infra/event-sync/src/main/java/com/simprints/infra/eventsync/sync/master/EventSyncMasterWorker.kt Updated master worker to support both Simprints and CommCare sync workflows
infra/event-sync/src/main/java/com/simprints/infra/eventsync/sync/down/workers/ Created base worker class and specialized implementations for Simprints and CommCare
infra/event-sync/src/main/java/com/simprints/infra/eventsync/event/commcare/CommCareEventDataSource.kt New CommCare content provider integration for data fetching
infra/config-store/src/main/proto/project_config.proto Extended configuration to support CommCare sync configuration
feature/setup/src/main/java/com/simprints/feature/setup/screen/ Enhanced setup flow to request CommCare permissions when needed
infra/resources/src/main/res/values/strings.xml Added CommCare-specific UI strings and renamed generic strings

@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch from 25c9d22 to 38ad617 Compare July 29, 2025 16:29
@BurningAXE BurningAXE marked this pull request as ready for review July 29, 2025 16:44
@BurningAXE BurningAXE requested review from a team, TristramN, alex-vt, alexandr-simprints, luhmirin-s, meladRaouf and ybourgery and removed request for a team July 29, 2025 17:20
Copy link
Copy Markdown
Contributor

@luhmirin-s luhmirin-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All things considered, LGTM.

Left a couple of nitpicks, suggestions and questions that I would prefer to resolve before approving.

@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch 2 times, most recently from ffbfeff to b065cea Compare July 31, 2025 17:00
@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch from b065cea to 20d2704 Compare August 18, 2025 14:13
@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch 2 times, most recently from 0312c4d to e529332 Compare August 18, 2025 14:43
@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch from e529332 to 30057b8 Compare August 18, 2025 14:56
@BurningAXE BurningAXE force-pushed the MS-1044-co-down-sync branch from 802dc12 to ee7ae0d Compare August 18, 2025 17:22
@sonarqubecloud
Copy link
Copy Markdown

@BurningAXE BurningAXE merged commit d3d7421 into main Aug 19, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants