-
Notifications
You must be signed in to change notification settings - Fork 305
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
use preference datastore to monitor syncJobStatus. #2142
Merged
santosh-pingle
merged 71 commits into
google:master
from
santosh-pingle:sp/issue-2119-datastore
Jan 2, 2024
Merged
use preference datastore to monitor syncJobStatus. #2142
santosh-pingle
merged 71 commits into
google:master
from
santosh-pingle:sp/issue-2119-datastore
Jan 2, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Screen.Recording.2023-08-23.at.2.10.12.PM.mov |
combine workstate and syncjobstatus Screen.Recording.2023-08-29.at.4.59.56.PM.mov |
jingtang10
requested changes
Aug 30, 2023
demo/src/main/java/com/google/android/fhir/demo/FhirApplication.kt
Outdated
Show resolved
Hide resolved
engine/src/test/java/com/google/android/fhir/FhirEngineProviderTest.kt
Outdated
Show resolved
Hide resolved
engine/src/test/java/com/google/android/fhir/FhirEngineProviderTest.kt
Outdated
Show resolved
Hide resolved
demo/src/main/java/com/google/android/fhir/demo/MainActivityViewModel.kt
Outdated
Show resolved
Hide resolved
anchita-g
suggested changes
Aug 31, 2023
demo/src/main/java/com/google/android/fhir/demo/MainActivityViewModel.kt
Outdated
Show resolved
Hide resolved
demo/src/main/java/com/google/android/fhir/demo/MainActivityViewModel.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/FhirDataStore.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/FhirDataStore.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/FhirSyncWorker.kt
Outdated
Show resolved
Hide resolved
7 tasks
Perhaps add #2046 getting resolved by this too ? |
MJ1998
previously requested changes
Oct 4, 2023
demo/src/main/java/com/google/android/fhir/demo/FhirApplication.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/FhirEngineProvider.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/FhirSyncWorker.kt
Outdated
Show resolved
Hide resolved
anchita-g
reviewed
Oct 4, 2023
demo/src/main/java/com/google/android/fhir/demo/MainActivityViewModel.kt
Show resolved
Hide resolved
omarismail94
reviewed
Oct 4, 2023
engine/src/main/java/com/google/android/fhir/sync/FhirDataStore.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/FhirDataStore.kt
Outdated
Show resolved
Hide resolved
anchita-g
reviewed
Oct 4, 2023
engine/src/main/java/com/google/android/fhir/sync/FhirDataStore.kt
Outdated
Show resolved
Hide resolved
Resolving conflicts. |
demo/src/main/java/com/google/android/fhir/demo/MainActivityViewModel.kt
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/CurrentSyncJobStatus.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/CurrentSyncJobStatus.kt
Outdated
Show resolved
Hide resolved
jingtang10
requested changes
Dec 20, 2023
engine/src/main/java/com/google/android/fhir/sync/SyncJobStatusSerializer.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/SyncJobStatusSerializer.kt
Outdated
Show resolved
Hide resolved
jingtang10
approved these changes
Dec 27, 2023
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.
thanks @santosh-pingle
@MJ1998 fyi
engine/src/main/java/com/google/android/fhir/sync/SyncJobStatus.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/sync/SyncJobStatus.kt
Outdated
Show resolved
Hide resolved
Owner has already approved the pr, hence dismissing it.
hugomilosz
pushed a commit
to hugomilosz/android-fhir
that referenced
this pull request
Jan 17, 2024
* Update syncJobStatus to preference datastore. * add fhirdatastore file. * code cleanup. * unit tests * unit test. * Cancel ongoing coroutine job before launching new oneTimeSync in demo app. * Fix android test, pass context instead of datastore in fhir engine configuration. * fix tests. * update kotlin doc. * combine work state with syncjobstatus * Address review comments. * Address review comments. * Update OneTimeSyncState and PeriodicSyncState. * missing file. * Stores sync job terminal state in the datastore. * Address review comments. * Address review comments. * Address review comments. * Address review comments. * code clean up. * Code clean up. * Fix test. * Fix test * Fix tests. * Address review comments. * Address review comments. * Remove DataStoreUtil. * Address review comments. * fix crash. * refactoring names * spotless apply * private access specifier * Address review comments. * Address review comment. * address review comments. * fix tests. * review comment. * Removing existing unwanted call. * Address review comments. * Add test to assert succedded sync state. * failed state was nit emitted. * Update api doc. * Address review comments. * Review address comments. * Address review comments. * Address review comment. * Address review comments. * Address review comment. * Address review comments. * remove unwanted file. --------- Co-authored-by: Santosh Pingle <spingle@google.com>
sharon2719
pushed a commit
to opensrp/android-fhir
that referenced
this pull request
Feb 6, 2024
* Update syncJobStatus to preference datastore. * add fhirdatastore file. * code cleanup. * unit tests * unit test. * Cancel ongoing coroutine job before launching new oneTimeSync in demo app. * Fix android test, pass context instead of datastore in fhir engine configuration. * fix tests. * update kotlin doc. * combine work state with syncjobstatus * Address review comments. * Address review comments. * Update OneTimeSyncState and PeriodicSyncState. * missing file. * Stores sync job terminal state in the datastore. * Address review comments. * Address review comments. * Address review comments. * Address review comments. * code clean up. * Code clean up. * Fix test. * Fix test * Fix tests. * Address review comments. * Address review comments. * Remove DataStoreUtil. * Address review comments. * fix crash. * refactoring names * spotless apply * private access specifier * Address review comments. * Address review comment. * address review comments. * fix tests. * review comment. * Removing existing unwanted call. * Address review comments. * Add test to assert succedded sync state. * failed state was nit emitted. * Update api doc. * Address review comments. * Review address comments. * Address review comments. * Address review comment. * Address review comments. * Address review comment. * Address review comments. * remove unwanted file. --------- Co-authored-by: Santosh Pingle <spingle@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2119
Description
Utilize the preference datastore to store SyncJobStatus. SyncJobStatus is serialized and subsequently updated within the preference datastore. The unique workname of the worker serves as the key for editing and reading the serialized data from the preference datastore.
Merge work state with SyncJobStatus.
Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.