Hello
We have some difficulties with Couchbase Lite, when we decide to revoke the access to a document.
For example, we want to remove the access to a document for a user after a validation from our API.
By referring to the documentation and various answers on the forum, clearing the document channel allows the user to no longer access the document but also to automatically purge it from the local database.
However, we do not achieve this result: documents with an empty channel are still present on the phone and they are still downloaded.
We test in this way:
- New application, therefore new database, we connect with a user.
- We wait a little while the synchronization is done.
- We recover the local database and analyze it (
adb
+cblite
). We check for the presence of a documentX
. - We empty the channel of the document
X
on the remote Couchbase side. - We wait for the synchronization to be successful.
- The database is recovered and we check the absence of document
X
. However, it is still present.
We also checked that the user does not have access to the admin channel (*
) and that the document is not public (!
).
A remark we made is that the document contains in these metadata a channels
property still containing the user’s email address:
"channels": {
"user@mail.fr": {
"seq": 985436,
"rev": "94-51c704ba1cb4bf4816b4817d600e4cde"
}
}
We check the list of documents to a channel, thanks to the get /db/_changes
REST API.
We saw a lots of documents, with "remove": ["user@mail.fr"]
:
{
"results":[
...
,{"seq":985436,"id":"X","removed":["user@mail.fr"],"changes":[{"rev":"94-51c704ba1cb4bf4816b4817d600e4cde"}]}
],
"last_seq":"986249"
}
Does this have anything to do with caching revisions and / or channels? What did we miss ?
CBL : 2.8.5
and SGW : 2.7.1
Thanks for your help
3 posts - 2 participants