google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
458 stars 238 forks source link

Update currentSyncJobStatus for oneTimeSync when syncJobStatus is null #2511

Open santosh-pingle opened 1 month ago

santosh-pingle commented 1 month ago

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #2472

Description WorkManager returns null status for ENQUEUED, RUNNING, and CANCELLED states. Now, if syncJobStatus is null, CurrentSyncJobStatus is created based on the WorkInfo state. If the WorkInfo state is SUCCEEDED or FAILED, then the sync job status is fetched from the FHIR data store.

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 Screenshots (if applicable)

Checklist

ndegwamartin commented 4 weeks ago

@santosh-pingle tested out the implementation, it works fine on our app and solves the issue we reported.