Hi,
We’re having an issue on our android application.
The replicator config is continuous and push only with auto purge disabled
We created a listener to delete documents that were replicated successfully to the cluster.
But we’re seeing documents getting replicated to the cluster multiple times, so the local deletion doesn’t seem to properly work.
Here’s the code we are using for the deletion :
replicator.addDocumentReplicationListener(replication -> {
if (replication.isPush()) {
for (ReplicatedDocument document : replication.getDocuments()) {
CouchbaseLiteException err = document.getError();
if (err == null){
try {
if (!replicator.isDocumentPending(document.getID())) {
database.purge(document.getID());
}
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
}
}
}
});
Is there a better way to make sure that the documents are locally deleted once replicated?
Thank you in advance