CBL iOS addDocumentReplicationListener ListenerToken.remove fails to remove listener

In the CBL Swift and Objective-C SDKs, the token returned by Replicator.addDocumentReplicationListener fails to remove the listener when calling ListenerToken.remove.

If you change this line of ReplicatorTest.testDocumentReplicationEvent from the deprecated replicator.removeChangeListener(withToken: token) to token.remove(), the test fails to remove the listener.

It also doesn’t work for removing Replicator.addChangeListener either.

This is strange as from the code it ends up calling the same code in Objective-C. Will need to look at this. I have created a ticket for investigation.

Thanks a lot for reporting this issue. I have tested it today and found the bug.

1 Like