Skip to content

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

Closed
ashishkumar468 opened this issue Jul 14, 2019 · 6 comments
Closed

Remove SyncService and SyncAdapter #3070

ashishkumar468 opened this issue Jul 14, 2019 · 6 comments

Comments

@ashishkumar468
Copy link
Collaborator

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

@ashishkumar468
Copy link
Collaborator Author

Would be great if @misaochan @maskaravivek @neslihanturan could share your views :-)

@misaochan
Copy link
Member

Would we not need to do periodic syncs once we implement the ability to pause/resume uploads?

@maskaravivek
Copy link
Member

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 SyncAdapter is just an overhead. A simple API call would be enough.

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.

@ashishkumar468
Copy link
Collaborator Author

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.

@ilgazer
Copy link
Contributor

ilgazer commented Jul 24, 2019

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.

@ashishkumar468
Copy link
Collaborator Author

This has already been implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants