Couchbase Lite Version: 1.4
Platform: iOS
What’s happening
We’re using Couchbase Lite 1.4 (iOS). We noticed that when the internet is gone, replication status turns to “Offline” which is expected. The user can still create documents offline as expected too.
The Problem
However, when internet is back, sync does not resume. Documents created locally does not get pushed to the server. Both replication objects (push and pull) still have the “Offline” status but both are “running”. Only when I stop the the replication and start it does sync resume. We use continuous replication for both the pull and push replicators.
Logged Pull and Push Replicator Statuses and Last Error.
11:21:00.751| Sync: CBLReplication[from http://xxx.xxx.xxx:4984/xxx]: idle, progress = 0 / 0, err: (null)
Replication Changed::::
PULL Status:: Optional(2)
PUSH Status:: Optional(2)
Is PULL Running? Optional(true)
Is PUSH Running? Optional(true)
PULL last error:: nil
PUSH last error:: nil
Turned Off Wifi
11:30:19.844‖ Sync: CBLRestPuller[http://xxx.xxx.xxx:4984/xxx]: Reachability state = <xxx.xxx.xxx>:unreachable (00), suspended=0
11:30:19.844‖ Sync: CBLRestPuller[http://xxx.xxx.xxx:4984/xxx]: Going offline
11:30:19.844‖ Sync: CBLRestPuller[http://xxx.xxx.xxx:4984/xxx]: postProgressChanged (0/0, active=0 (batch=0, net=0), lastSeq=61955, online=0, error=(null))
11:30:19.853‖ Sync: CBLRestPuller[http://xxx.xxx.xxx:4984/xxx]: ChangeTracker stopped; error=(null)
11:30:19.854| Sync: CBLReplication[from http://xxx.xxx.xxx:4984/xxx]: offline, progress = 0 / 0, err: (null)
Replication Changed::::
PULL Status:: Optional(1)
PUSH Status:: Optional(2)
Is PULL Running? Optional(true)
Is PUSH Running? Optional(true)
PULL last error:: nil
PUSH last error:: nil
11:30:19.865‖ Sync: CBLRestPusher[http://xxx.xxx.xxx:4984/xxx]: Reachability state = <xxx.xxx.xxx>:unreachable (00), suspended=0
11:30:19.865‖ Sync: CBLRestPusher[http://xxx.xxx.xxx:4984/xxx]: Going offline
11:30:19.865‖ Sync: CBLRestPusher[http://xxx.xxx.xxx:4984/xxx]: postProgressChanged (0/0, active=0 (batch=0, net=0), lastSeq=6667, online=0, error=(null))
11:30:19.865| Sync: CBLReplication[to http://xxx.xxx.xxx:4984/xxx]: offline, progress = 0 / 0, err: (null)
Replication Changed::::
PULL Status:: Optional(1)
PUSH Status:: Optional(1)
Is PULL Running? Optional(true)
Is PUSH Running? Optional(true)
PULL last error:: nil
PUSH last error:: nil
When I turn the Wifi back on again, all the documents I made locally are not being pushed. I’m also not receiving new changes from the server. More than 30 minutes have passed but still no change in status. Only when I stop sync and starting will I be able to pull and push changes.