_active_tasks: when can I know when the sync process has finished?

37 views
Skip to first unread message

Federico Hernandez

unread,
Feb 3, 2015, 10:58:02 AM2/3/15
to mobile-c...@googlegroups.com
Hi everybody,

I've created a phonegap app on iOS using JavaScript. I can push and pull data from the sync gateway and see the new data on couch server. To do so, I've created two sync managers, one to the push data and the other to do the pull process. Now, I'd like to know when the sync process (pulling data from SG) has finished. Should I query the _active_tasks endpoint to know the replication status? If so, there're several possible status: processed, idle, active, offline and stopped. When the app starts up, I start querying the replication status. I get the "processed" status several times until I get the "idle" status. After that I load a list view to show the documents. Is the "idle" status the one to know when the sync process has finished? Is this the right way to check the status?

Thanks in advance,

Jens Alfke

unread,
Feb 3, 2015, 11:58:21 AM2/3/15
to mobile-c...@googlegroups.com

On Feb 3, 2015, at 7:58 AM, Federico Hernandez <fede.he...@gmail.com> wrote:

Is the "idle" status the one to know when the sync process has finished? Is this the right way to check the status?

Yes, check for Idle or Stopped. There's been a lot of discussion of this, so search the list archives for more info.

—Jens

Federico Hernandez

unread,
Feb 3, 2015, 2:34:41 PM2/3/15
to mobile-c...@googlegroups.com
Thanks Jens, it was not clear enough in the other posts.

Sandra

unread,
Apr 9, 2015, 1:04:39 PM4/9/15
to mobile-c...@googlegroups.com
Hello Federico, I'm interested in knowing how you achieve this, as I want to do the same. Would you please share?
BR, Sandra

Federico Hernandez

unread,
Apr 9, 2015, 2:15:41 PM4/9/15
to mobile-c...@googlegroups.com
Hi Sandra,

Do you want the app or more info about the issue? The app was for a customer, so I should get rid of all the customer related code to share the app.
Reply all
Reply to author
Forward
0 new messages