We're using the CBL for iOS on branch `release/1.2.2`. We have a
`replicate` method that gets called during initial login as well as
periodically based on a timer or if the app is backgrounded and
foregrounded. These are one shot replications and not continuous.
(void)replicate
{
[self.pullReplication start];
[self.pushReplication start];
}
The databases for the push and pull replication don't exist yet upon
initial login and are created as part of the `self.pullReplication` and
`self.pushReplication` method calls similar to below.
- (CBLReplication *)pullReplication
{
*if* (!_pullReplication)
{
_pullReplication = [self.database createPullReplication:self.
pullReplicationURL];
}
*return* _pullReplication;
}
- (CBLReplication *)pushReplication
{
*if* (!_pushReplication)
{
_pushReplication = [self.database createPushReplication:self.
pushReplicationURL];
}
*return* _pushReplication;
}
During the initial login the databases are created properly and the push
and pull replication seems to happen successfully watching the logging by
enabling `-Log YES`, `-LogSync YES`, and -LogSyncVerbose YES`. However the
next time `replicate` is called after the initial login the logging only
shows the pull replication and not the push replication.
Upon further inspection the pull replication `status` is
`kCBLReplicationStopped` whereas the push replication `status` is
`kCBLReplicationIdle` after the initial login. If the app is stopped and
re-started both pull and push replication statuses are
`kCBLReplicationStopped` and both push and pull replications show up
properly in the logging. However there seems to be some sort of race
condition during the initial login which causes the push replication to get
stuck in the `kCBLReplicationIdle` status. I just wanted to see if this
was expected behavior or potentially a bug in CBL iOS. Thanks.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/0b5602a4-6f54-4815-a068-6c10e23b618f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.