Good morning everybody. I have this use case, and I need help about how to deal some kind of documents.
We have a mobile application running on a single device (alias Master) connected to the sync gateway, and we have other N devices (Slaves) connected to the master using the peer 2 peer feature.
We have this kind of documents where they are all spread to all the devices and into the server. Once the user does an operation, modifying these documents, they have to be moved out of the phone channel and stored only to the server through the sync gateway, then once confirmed the “moving” they have to be purged from all the mobile devices.
So this is what I can do at the moment.
On the master, when the documents are in this condition, using the DocumentReplicationListener on the sync gateway replicator, I can verify when the reach the sync gateway so I can PURGE the documents
Same approach on the slaves using the DocumentReplicationListener on the peer 2 peer replicator.
In this case the document has been purged from the master but a slave initially not connected once back online it does not receive the change related to the document and it still exist on the database.
I have tried to DELETE the documents on the master instead to purge them, but in this case the documents have been deleted also on the server.
So basically I think I need to delete the document to send the deletion to the other mobile devices, but this deletion does not have to be propagated to the server.
Thanks for any suggestion and have a nice day.