Continuous Pull Replicator went to stopped instead of idle

Description

This has found by running a test in iOS : https://github.com/couchbase/couchbase-lite-ios/blob/master/Objective-C/Tests/DatabaseTest.m#L1534-L1564. The test failed as it is waiting for both push and pull replicator to be IDLE. It turns out pull replicator just went to stopped instead of idle.

I have debugged and it turned out there is a bug in `Replicator::computeActivityLevel()` that causes the following line to get executed when the continuous pull replicator is idle.

https://github.com/couchbase/couchbase-lite-core/blob/master/Replicator/Replicator.cc#L427

The real problem is that isContinuous() returns false. The code is very suspicious and it also loses track of the collection index:

https://github.com/couchbase/couchbase-lite-core/blob/master/Replicator/Worker.hh#L148-L153

Activity

Show:

CB robot September 2, 2022 at 8:51 PM

Build couchbase-lite-log-3.1.0-172 contains couchbase-lite-core commit 2444918 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3526#icft=CBL-3526 : Continuous Pull Replicator went to stopped instead of idle (#1535)

CB robot September 2, 2022 at 7:39 PM

Build couchbase-lite-cblite-3.1.0-162 contains couchbase-lite-core commit 2444918 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3526#icft=CBL-3526 : Continuous Pull Replicator went to stopped instead of idle (#1535)

CB robot August 12, 2022 at 9:44 PM

Build couchbase-lite-net-3.1.0-87 contains couchbase-lite-core commit 2444918 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3526#icft=CBL-3526 : Continuous Pull Replicator went to stopped instead of idle (#1535)

CB robot August 12, 2022 at 6:58 PM

Build couchbase-lite-c-3.1.0-144 contains couchbase-lite-core commit 2444918 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3526#icft=CBL-3526 : Continuous Pull Replicator went to stopped instead of idle (#1535)

CB robot August 12, 2022 at 2:54 AM

Build couchbase-lite-ios-3.1.0-209 contains couchbase-lite-core commit 2444918 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3526#icft=CBL-3526 : Continuous Pull Replicator went to stopped instead of idle (#1535)

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created August 2, 2022 at 10:15 PM
Updated September 2, 2022 at 8:51 PM
Resolved August 3, 2022 at 8:58 PM
Instabug