Skip to content
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

Add a SyncJobStatus result callback amid Sync retries #2049

Closed
ndegwamartin opened this issue Jun 26, 2023 · 4 comments · May be fixed by opensrp/android-fhir#15
Closed

Add a SyncJobStatus result callback amid Sync retries #2049

ndegwamartin opened this issue Jun 26, 2023 · 4 comments · May be fixed by opensrp/android-fhir#15
Assignees
Labels
P1 High priority issue

Comments

@ndegwamartin
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently, there is no way for reliant apps to obtain the exceptions from backend calls until all Sync retries are completed by the FhirSyncWorker class. Our app would like to process the exceptions as soon as they happen.

Describe the solution you'd like
We'd like to add an abstract method to the FhirSyncWorker.kt class that would need to be implemented by the reliant app. It should accept a parameter of type SyncJobStatus.

For example:

abstract fun onSyncJobResult(syncJobStatus: SyncJobStatus)

It should then be invoked within the FhirSyncWorker.doWork method after the result is obtained.

Describe alternatives you've considered
We could also just log the failures in an open method that could be overridden by the reliant app. This way they'd have the ability to obtain the exceptions that are part of the SyncJobStatus.Failed instance. The SDK could log those errors in its implementation(as default).

For example:

open fun onFailedSyncJobResult(failedSyncJobStatus: SyncJobStatus.Failed){
     Timber.e(failedSyncJobStatus.exceptions);
}

Additional context
N/A

Would you like to work on the issue?
Yes

ndegwamartin added a commit to opensrp/android-fhir that referenced this issue Aug 23, 2023
ndegwamartin added a commit to opensrp/android-fhir that referenced this issue Aug 23, 2023
ndegwamartin added a commit to opensrp/android-fhir that referenced this issue Aug 23, 2023
@jingtang10
Copy link
Collaborator

@santosh-pingle

@jingtang10 jingtang10 added the P1 High priority issue label Sep 7, 2023
@santosh-pingle
Copy link
Collaborator

santosh-pingle commented Feb 5, 2024

duplicate of # #2049

EDITED by @jingtang10

@fredhersch fredhersch reopened this Feb 7, 2024
@santosh-pingle
Copy link
Collaborator

duplicate of # #2049

EDITED by @jingtang10
my bad, I mentioned the same issue.

@aditya-07 #2371 are these similar issues?

@jingtang10
Copy link
Collaborator

closing in favour of #1654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

4 participants