Stopping Replication & Change Listeners

I’ve run into what seems to be a chicken and egg scenario regarding stopping replicators in Couchbase Lite Swift / iOS.

The documentation indicates we should remove replication change listeners before stopping a replicator. However, it also indicates stopping a replicator is an asynchronous action and we should wait for the replicator to change to the stopped state before taking further actions, such as deleting the database. What is the recommended method to do this in the absence of, well, using a change listener on the replicator to detect when it entered the stopped state?


  • Scott

Well, the good news is that this is not an actual problem. The bad news is that our docs have a mistake to make people think it is. We have an open docs issue to remove this sentence from the docs (filed against C#, but these documentations are meant to be kept in line with one another):