Replication Complete Information

79 views
Skip to first unread message

Pankaj Jakhar

unread,
Apr 4, 2014, 2:45:25 AM4/4/14
to mobile-c...@googlegroups.com
How can I know if the replication process has ended on Couchbaslite Android application? 

I want to allow login in my app only after it has synced all the data with server. SO I need to know when the syncing of its pull and push replication is completed.

How can I achieve this?

Jens Alfke

unread,
Apr 4, 2014, 10:18:40 AM4/4/14
to mobile-c...@googlegroups.com
On Apr 3, 2014, at 11:45 PM, Pankaj Jakhar <pankaj...@gmail.com> wrote:

How can I know if the replication process has ended on Couchbaslite Android application? 

Watch for the status property of the Replication object to change to ‘stopped’ or ‘idle’.

I want to allow login in my app only after it has synced all the data with server.

That sounds sort of backwards … how are you authenticating to the server if the user hasn’t logged in?

—Jens

Traun Leyden

unread,
Apr 4, 2014, 4:48:35 PM4/4/14
to mobile-c...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/ae308cfb-2e42-4865-9ff3-ca90844a9ecf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pankaj Jakhar

unread,
May 1, 2014, 4:52:36 AM5/1/14
to mobile-c...@googlegroups.com
Hi Traun

I have already implemented a replication change listener interface which lets me know about the status of replication. But the problem is that before replication is completed 100%, I get Replication IDLE status 2-3 while replication is going on. The status is ACTIVE 98% times but 2-3 times in between this replication, the status becomes IDLE and then ACTIVE again and after 100% completion it is always IDLE.

So this IDLE status before 100% completion is what is creating problem in my logic. If I rely on status IDLE then still 100% is left.

Traun Leyden

unread,
May 13, 2014, 8:26:49 PM5/13/14
to mobile-c...@googlegroups.com


On Thursday, May 1, 2014, Pankaj Jakhar <pankaj...@gmail.com> wrote:

I have already implemented a replication change listener interface which lets me know about the status of replication. But the problem is that before replication is completed 100%, I get Replication IDLE status 2-3 while replication is going on. The status is ACTIVE 98% times but 2-3 times in between this replication, the status becomes IDLE and then ACTIVE again and after 100% completion it is always IDLE.

So this IDLE status before 100% completion is what is creating problem in my logic. If I rely on status IDLE then still 100% is left.

Can you retest with the latest code on the master branch and post the logs on pastebin or something similar?

The logs in Replication.updateActive() might reveal what's going on.

 
Reply all
Reply to author
Forward
0 new messages