android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

Subsequent OneTime sync triggers always start with CurrentSyncJobStatus.SUCCEDED status

Open ndegwamartin opened this issue 11 months ago • 4 comments

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 Screenshot 2024-03-12 at 12 15 46

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

ndegwamartin avatar Mar 12 '24 09:03 ndegwamartin

Thanks @ndegwamartin for identifying this. @santosh-pingle I think this should be a small change ?

MJ1998 avatar Mar 12 '24 16:03 MJ1998

Looking into it.

santosh-pingle avatar Apr 15 '24 08:04 santosh-pingle

@ndegwamartin Can you please check whether the issue is fixed with this change #2511

santosh-pingle avatar Apr 16 '24 13:04 santosh-pingle

Yeah this fixes it, left a comment on the PR

ndegwamartin avatar Apr 19 '24 11:04 ndegwamartin