We have a hybrid mobile app with PouchDB as the local DB and Sync Gateway to sync with CouchDB. We have a backend where we can enter/delete data as well. I need to know what is the functionality when we set the _exp of a document in syncgateway.
The scenario is as follows.
- Log in to the app.
- Do some actions which modifies some document(s).
- Immediately log out after the action get processed from backend and before all the updated documents gets synced from backend to syncgateway.
- Delete the document in backend and set the _exp to 3mins.
- Wait until 3 mins pass, check the syncgateway , the document get deletes effecting _exp.
- Now there’s no document in syncgateway but it is in local cache.
- Login with the same user.
- Looking for the document in the app and it still displays data.
- Which means even if the document is not in syncgateway, the document in local db is not deleted and this is wrong as per the practical scenario.
My question is, how can we make this document in local cache get to delete?