-
Notifications
You must be signed in to change notification settings - Fork 59
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
3126 refactor config registry #3249
Conversation
…nd processCompositionManifest
# Conflicts: # android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/ConfigurationRegistry.kt
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3249 +/- ##
==========================================
+ Coverage 29.6% 47.2% +17.5%
+ Complexity 658 10 -648
==========================================
Files 239 4 -235
Lines 11204 235 -10969
Branches 1948 31 -1917
==========================================
- Hits 3323 111 -3212
+ Misses 7447 116 -7331
+ Partials 434 8 -426
Flags with carried forward coverage won't be shown. Click here to find out more. |
# Conflicts: # android/engine/src/main/java/org/smartregister/fhircore/engine/sync/SyncListenerManager.kt # android/engine/src/test/java/org/smartregister/fhircore/engine/sync/SyncBroadcasterTest.kt # android/engine/src/test/java/org/smartregister/fhircore/engine/sync/SyncListenerManagerTest.kt
@@ -830,4 +898,276 @@ constructor( | |||
ResourceType.Parameters, | |||
) | |||
} | |||
|
|||
private suspend fun fetchCompositionConfig(coroutineScope: CoroutineScope) { | |||
val compConfigFlow1 = Sync.oneTimeSync<CompositionSyncWorker>(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use full names for the variables e.g. compositionConfigFlow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
val compConfigFlow1 = Sync.oneTimeSync<CompositionSyncWorker>(context) | ||
compConfigFlow1.handleCompositionSyncJobStatus(coroutineScope) | ||
compConfigFlow1.collect { compConfigFlowJobStatus -> | ||
when (compConfigFlowJobStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAB(Same as above). compositionConfigFlowJobStatus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
|
||
resourceIds.forEach { | ||
Timber.d("configSync composition Config adding resourceType - ${resourceType} and id= ${it}") | ||
val compConfigParamPairsReq = mutableListOf<Pair<ResourceType, Map<String, String>>>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
|
||
private suspend fun fetchCompositionManifestRequest(coroutineScope: CoroutineScope) { | ||
|
||
val compositionManifestFlow4 = Sync.oneTimeSync<CompositionManifestSyncWorker>(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove the No. 4 suffix here since it is the only flow in this methods scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
} | ||
|
||
private suspend fun fetchCompositionListRequest(coroutineScope: CoroutineScope) { | ||
val compListFlow2 = Sync.oneTimeSync<CompositionListSyncWorker>(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
} | ||
|
||
private suspend fun fetchCompositionConfigRequest(coroutineScope: CoroutineScope) { | ||
val compositionConfigFlow3 = Sync.oneTimeSync<CompositionConfigSyncWorker>(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
|
||
|
||
private suspend fun fetchCompListItemRequest(coroutineScope: CoroutineScope) { | ||
val compListFlow2 = Sync.oneTimeSync<CompListItemSyncWorker>(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
added unit tests for worker classes
I am closing this PR. I will create a new one with fewer code changes. |
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #3126
Engineer Checklist
strings.xml
file./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the project's style guideCode Reviewer Checklist
strings.xml
file