android-fhir
android-fhir copied to clipboard
Subsequent OneTime sync triggers always start with CurrentSyncJobStatus.SUCCEDED status
Describe the bug
When One time sync is triggered again, the state is first retrieved from the syncJobStatusFromWorkManager
(screenshot). A null check is performed and if the state returned is null the state is retrieved from the sync job status datastore. This will hold the status of the previous one time sync.
This means that on subsequent one time syncs, we have no way of capturing the state that a new sync has started. This is important so that for instance we can show a UI that shows Sync process is starting. The main issue with the UX is that every time we trigger it subsequently, it first shows a Sync complete dialog then it proceds to do the actual sync after which it shows the sync complete dialog again.
Component Core library
To Reproduce Steps to reproduce the behavior:
- Trigger a one time sync multiple times
Expected behavior
We should always return a job status like Running.Started
or Enqueued
for every fresh onetime sync trigger in order to update UX accordingly.
Screenshots
Smartphone (please complete the following information): N/A
Additional context Add any other context about the problem here.
Would you like to work on the issue? Sure, however @santosh-pingle recently worked on the original feature
Thanks @ndegwamartin for identifying this. @santosh-pingle I think this should be a small change ?
Looking into it.
@ndegwamartin Can you please check whether the issue is fixed with this change #2511
Yeah this fixes it, left a comment on the PR