-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove SyncService and SyncAdapter #3070
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
Comments
Would be great if @misaochan @maskaravivek @neslihanturan could share your views :-) |
Would we not need to do periodic syncs once we implement the ability to pause/resume uploads? |
Sync adapter is mostly used when you want to schedule periodic syncs in the background. Our sync adapter does nothing of that sort. It simply triggers sync when MainActivity is opened. Since we don't intend to perform background syncs As far as pause/resume uploads or dynamic update of list is concerned, it would be taken care of by live data once we move to Room DB. |
Also, the sync adapter as of now is meant to sync contributions and takes no part in upload. The Upload is happening from a separate service (UploadService), which will be modified along with others to support Pause/Resume. |
IMO it would be better if we did away with ContributionsSyncAdapter and connected our data sources(ContributionDao for failed uploads etc. and UserClient for online data) to the RecyclerView directly. How important is caching the user's contributions offline? If we did away with offline caching of contributions, we could maybe fetch the images in the pre-upload stage from UploadService and do away with ContributionsDao as well. |
This has already been implemented |
Summary:
The app uses SyncService and SyncAdapter which does nothing but makes the api call and saves the data in db, the same can be done from the Activity as well. The Sync service is useful only when our backend supports that(send us data letting us know that do we need to sync), or if we use periodic syncs. As currently our app uses none of them. We can simply shift to making the api call from the activity itself
The text was updated successfully, but these errors were encountered: