Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling sync status by harmonizing SDK and custom sync statuses #3650

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

Lentumunai-Mark
Copy link
Contributor

@Lentumunai-Mark Lentumunai-Mark commented Dec 10, 2024

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #3687

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 6.01504% with 250 lines in your changes missing coverage. Please review.

Project coverage is 37.8%. Comparing base (a790c9d) to head (2ae8519).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../fhircore/engine/sync/CustomResourceSyncService.kt 0.0% 77 Missing ⚠️
...rcore/quest/ui/shared/components/SyncStatusView.kt 0.0% 38 Missing ⚠️
...ter/fhircore/quest/ui/register/RegisterFragment.kt 0.0% 29 Missing ⚠️
...re/quest/ui/geowidget/GeoWidgetLauncherFragment.kt 0.0% 24 Missing ⚠️
...martregister/fhircore/engine/sync/AppSyncWorker.kt 4.5% 21 Missing ⚠️
...rtregister/fhircore/engine/sync/SyncBroadcaster.kt 0.0% 16 Missing ⚠️
...core/engine/configuration/ConfigurationRegistry.kt 8.3% 11 Missing ⚠️
...register/fhircore/quest/ui/main/AppMainActivity.kt 0.0% 11 Missing ⚠️
...ter/fhircore/quest/ui/main/components/AppDrawer.kt 0.0% 9 Missing ⚠️
...egister/fhircore/quest/ui/main/AppMainViewModel.kt 54.5% 5 Missing ⚠️
... and 5 more

❌ Your patch check has failed because the patch coverage (6.0%) is below the target coverage (60.0%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3650     +/-   ##
=========================================
- Coverage     38.6%   37.8%   -0.8%     
+ Complexity    1168    1150     -18     
=========================================
  Files          286     287      +1     
  Lines        15291   15468    +177     
  Branches      2697    2714     +17     
=========================================
- Hits          5907    5858     -49     
- Misses        8536    8772    +236     
+ Partials       848     838     -10     
Flag Coverage Δ
engine 60.7% <2.3%> (-2.1%) ⬇️
geowidget 16.0% <ø> (ø)
quest 24.4% <9.5%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...gister/fhircore/engine/util/SharedPreferenceKey.kt 100.0% <100.0%> (ø)
...er/fhircore/engine/util/SharedPreferencesHelper.kt 52.7% <ø> (+2.7%) ⬆️
...artregister/fhircore/quest/ui/main/AppMainEvent.kt 95.2% <100.0%> (+0.7%) ⬆️
...hircore/quest/ui/shared/models/AppDrawerUIState.kt 100.0% <100.0%> (ø)
...gister/fhircore/engine/sync/SyncListenerManager.kt 66.6% <0.0%> (-14.2%) ⬇️
...rg/smartregister/fhircore/engine/sync/SyncState.kt 0.0% <0.0%> (ø)
...core/quest/ui/geowidget/GeoWidgetLauncherScreen.kt 0.0% <0.0%> (ø)
...ister/fhircore/quest/ui/register/RegisterScreen.kt 0.0% <0.0%> (ø)
...egister/fhircore/quest/ui/main/AppMainViewModel.kt 68.1% <54.5%> (-0.6%) ⬇️
...ircore/quest/ui/usersetting/UserSettingFragment.kt 0.0% <0.0%> (ø)
... and 9 more

... and 3 files with indirect coverage changes

@Lentumunai-Mark Lentumunai-Mark changed the title Register custom sync status. Fix Sync Status: Harmonize FHIR and Custom Sync Completion for 'Sync Complete' Dec 13, 2024
pld
pld previously approved these changes Dec 14, 2024
Copy link
Member

@pld pld left a comment

Choose a reason for hiding this comment

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

looks good! can you please cover the new code paths with tests, thank you!

@pld pld added this pull request to the merge queue Dec 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 14, 2024
@Lentumunai-Mark Lentumunai-Mark marked this pull request as draft December 16, 2024 13:16
@ellykits ellykits changed the title Fix Sync Status: Harmonize FHIR and Custom Sync Completion for 'Sync Complete' Fix handling sync status by harmonizing SDK and custom sync statuses Jan 8, 2025
@Lentumunai-Mark Lentumunai-Mark marked this pull request as ready for review January 14, 2025 02:13
ellykits and others added 4 commits January 31, 2025 13:21
Harmonize custom resource and app sync. Each sync is identified by
a counter. The max sync count is 2.

Signed-off-by: Elly Kitoto <[email protected]>
Signed-off-by: Lentumunai-Mark <[email protected]>
@ellykits
Copy link
Collaborator

@HenryRae Can you review this? For context, we are trying to harmonize the sync UI. For EUSM we run 2 kinds of sync. The first sync downloads the location hierarchy and the second downloads/uploads user data. Right now, it's technically easier to separate the sync processes and observe their states independently. The first sync needs to be completed before the second sync is started. We need a way to notify the user when any syncs are running. For now, we show progress and success/failure for both as seen in the screenshots.

Screenshot_20250131_164131

Screenshot_20250131_164221

@HenryRae
Copy link

HenryRae commented Feb 3, 2025

@HenryRae Can you review this? For context, we are trying to harmonize the sync UI. For EUSM we run 2 kinds of sync. The first sync downloads the location hierarchy and the second downloads/uploads user data. Right now, it's technically easier to separate the sync processes and observe their states independently. The first sync needs to be completed before the second sync is started. We need a way to notify the user when any syncs are running. For now, we show progress and success/failure for both as seen in the screenshots.

Screenshot_20250131_164131

Screenshot_20250131_164221

@ellykits This is okay, we can show the second progress 3-5 seconds after the first sync success message

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.

[EUSM] Sync shows sync complete even when not complete
6 participants