I went through this document, but unable to remove document access on the sync gateway.
FYI: I’m using Couchbase Lite 2.8.6 on the mobile (Xamarin SDK)
document:
{
"channels": [
"3a7c15ba2241"
],
"docType": "logentry",
"creator": "14bd9d1d7a",
"createdOn": "2022-03-30T13:37:42.5070600-04:00",
"subjectId": "14bd9d1d7a",
"modifier": "14bd9d1d7a",
"modifiedOn": "2022-03-30T13:37:42.5070600-04:00",
"deleter": null,
"writers": [
"14bd9d1d7a",
"7c15ba2241"
],
"sequenceId": "0",
"_id": "evt..14bd9d1d7a..69856d73a",
"_rev": null,
"_deleted": false,
"insert_id": "evt..14bd9d1d7a..69856d73a",
"device_id": "5E634E1C226",
"user_id": "14bd9d1d7a",
"event_type": "Signup",
"origin": null,
"time": 1648661795504
}
sync function:
if (doc.docType === "logentry") {
channel("logevents");
return;
}
I expected that by doing this in sync gateway, the channel is updated and the user doesn’t have the access to logentry
channel so the document will be purged. But I still see the documents in the device (phone) CB Lite. Based on the documentation, an event is triggered and those documents are purged, which isn’t happening.
Based on the document here:
### Auto-purge on Channel Access Revocation
Previously (**before v3.0**) these documents remained in the local database
Prior to this relese, CBL auto-purged only in the case when the user loses access to a document by removing the doc from all of the channels belong to the user. Now, in addition to 2.x auto purge, Couchbase Lite will also auto-purges the docs when the user loses access to the doc via channel access revocation. This feature is enabled by default, but an opt-out is available.
Does it mean that the user would still have access to those document? If yes, then
- what is the “auto purge” really doing if its not removing access?
- After the app is relaunched user is not able to access those docs, is this expected?
- Can anyone suggest how I can remove document access and subsequently purges the document from the database?